This is a combination of 4 commits.

Fix the image
This commit is contained in:
2024-03-19 17:20:32 +01:00
parent 124b5552be
commit 58c1b91916
8 changed files with 256 additions and 130 deletions

View File

@ -0,0 +1,22 @@
package email
import (
"net/smtp"
)
type EmailConf struct {
From string
Password string
SmtpHost string
SmtpPort string
}
func (e *EmailConf) SendEmail (to string, message string )error {
messageByte := []byte(message)
auth := smtp.PlainAuth("", e.From, e.Password, e.SmtpHost)
if err := smtp.SendMail(e.SmtpHost+":"+e.SmtpPort, auth, e.From, []string{to}, messageByte); err != nil {
return err
}
return nil
}