This commit is contained in:
teddy
2025-05-05 12:01:24 +07:00
parent 55d76d0d8c
commit e09d96c8a6
4 changed files with 8 additions and 5 deletions

View File

@@ -11,6 +11,7 @@ import (
"net/http"
"net/smtp"
"reflect"
"strings"
"time"
"github.com/go-playground/validator/v10"
@@ -76,9 +77,11 @@ func FormatSince(t time.Time) string {
func SendEmail(to []string, cc []string, name, subject, message, htmlString string) error {
sender := "From: HIS <hats.nutech@gmail.com>\n"
subjectt := "Subject: " + subject + "\n"
mime := "MIME-version: 1.0;\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
mime := "MIME-Version: 1.0\nContent-Type: text/html; charset=\"UTF-8\";\n\n"
body := htmlString
messages := []byte(sender + subjectt + mime + body)
emailTo := "To:" + strings.Join(to, ",") + "\n"
emailCC := "Cc: " + strings.Join(cc, ",") + "\n"
messages := []byte(sender + emailTo + emailCC + subjectt + mime + body)
for _, v := range cc {
if v != "" {

View File

@@ -47,7 +47,7 @@
<b>HIS</b>
</p>
<img
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
src="https://i.imgur.com/Stbilmj.png"
alt="logo"
width="100px"
/>

View File

@@ -45,7 +45,7 @@
<div class="footer">
<p>Email ini dikirim oleh sistem.</p>
<img
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
src="https://i.imgur.com/Stbilmj.png"
alt="logo"
width="100px"
/>

View File

@@ -61,7 +61,7 @@
</div>
<div class="content">
<img
src="http://36.66.3.44:7008/get-link?name=LOGO_HIS_NI_New_Contrasted-removebg-preview.png"
src="https://i.imgur.com/Stbilmj.png"
alt="logo"
width="100px"
/>