fix: proper smtp relay, therefore required new config parameter

master
phga 1 year ago
parent 6a1cafa8e3
commit 4bf28c99e3
Signed by: phga
GPG Key ID: 5249548AA705F019

@ -21,6 +21,7 @@ type Config struct {
MariaDbPort string `json:"mariadb_port"`
MailUser string `json:"mail_user"`
MailPass string `json:"mail_pass"`
MailSmtpUser string `json:"mail_smtp_user"`
MailSmtpServer string `json:"mail_smtp_server"`
MailSmtpPort string `json:"mail_smtp_port"`
UserCreationSecret string `json:"user_creation_secret"`

@ -16,7 +16,7 @@ Content-Type: text/plain; charset="UTF-8"
`
header = fmt.Sprintf(header, from, to, subject)
mailTxt = header + mailTxt
auth := smtp.PlainAuth("", from, config.MailPass, config.MailSmtpServer)
auth := smtp.PlainAuth("", config.MailSmtpUser, config.MailPass, config.MailSmtpServer)
err := smtp.SendMail(config.MailSmtpServer+":"+config.MailSmtpPort, auth, from, []string{to}, []byte(mailTxt))
return err
}

Loading…
Cancel
Save