Updated adminmailer to separate FromAddress and ServerUsername

This commit is contained in:
Asaf Gartner 2023-06-15 17:46:43 +03:00
parent 54aa6682b1
commit 633f8f1007
2 changed files with 3 additions and 2 deletions

View File

@ -4,6 +4,7 @@ const RecvAddress = "admin@example.com"
const RecvName = "Admin"
const FromName = "From Name"
const FromAddress = "from@address.com"
const FromAddressPassword = "password"
const ServerUsername = "username"
const ServerPassword = "password"
const ServerAddress = "server.address"
const ServerPort = 587

View File

@ -46,7 +46,7 @@ func sendMail(toAddress, toName, subject, contentHtml string) error {
)
return smtp.SendMail(
fmt.Sprintf("%s:%d", ServerAddress, ServerPort),
smtp.PlainAuth("", FromAddress, FromAddressPassword, ServerAddress),
smtp.PlainAuth("", ServerUsername, ServerPassword, ServerAddress),
FromAddress,
[]string{toAddress},
contents,