Add error handling for message submission
j3s j3s@c3f.net
Mon, 23 Dec 2019 13:46:05 -0600
1 files changed,
4 insertions(+),
1 deletions(-)
jump to
M
main.go
→
main.go
@@ -356,7 +356,10 @@ recipients = append(recipients, a.Address)
} auth := smtp.PlainAuth("", gConfig.SMTPUsername, gConfig.SMTPPassword, "mail.c3f.net") - smtp.SendMail("mail.c3f.net:587", auth, e.Sender.Address, recipients, e.ToBytes()) + err := smtp.SendMail("mail.c3f.net:587", auth, e.Sender.Address, recipients, e.ToBytes()) + if err != nil { + log.Printf("ERROR SENDING MAIL: %q\n", err) + } } // MAILING LIST LOGIC /////////////////////////////////////////////////////////