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 RecvName = "Admin"
|
||||||
const FromName = "From Name"
|
const FromName = "From Name"
|
||||||
const FromAddress = "from@address.com"
|
const FromAddress = "from@address.com"
|
||||||
const FromAddressPassword = "password"
|
const ServerUsername = "username"
|
||||||
|
const ServerPassword = "password"
|
||||||
const ServerAddress = "server.address"
|
const ServerAddress = "server.address"
|
||||||
const ServerPort = 587
|
const ServerPort = 587
|
||||||
|
|
|
@ -46,7 +46,7 @@ func sendMail(toAddress, toName, subject, contentHtml string) error {
|
||||||
)
|
)
|
||||||
return smtp.SendMail(
|
return smtp.SendMail(
|
||||||
fmt.Sprintf("%s:%d", ServerAddress, ServerPort),
|
fmt.Sprintf("%s:%d", ServerAddress, ServerPort),
|
||||||
smtp.PlainAuth("", FromAddress, FromAddressPassword, ServerAddress),
|
smtp.PlainAuth("", ServerUsername, ServerPassword, ServerAddress),
|
||||||
FromAddress,
|
FromAddress,
|
||||||
[]string{toAddress},
|
[]string{toAddress},
|
||||||
contents,
|
contents,
|
||||||
|
|
Loading…
Reference in New Issue