Updated adminmailer to separate FromAddress and ServerUsername
This commit is contained in:
parent
54aa6682b1
commit
633f8f1007
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
Reference in New Issue