go-gomail / gomail

The best way to send emails in Go.
MIT License
4.3k stars 570 forks source link

Send mail to Amazon SES fails #131

Closed jeffaco closed 5 years ago

jeffaco commented 5 years ago

A work on a different open source project. That project, as part of it's function, sends E-Mail. The original problem report is here:

Sending a test mail to SES failed:

root@grad:/opt/duplicacy-util# duplicacy-util -tn -sd /opt/duplicacy-util
07:05:12 Using global config: /opt/duplicacy-util/duplicacy-util.yaml
Error: gomail: could not send email 1: 554 Transaction failed: Expected '/', got ;
Error: gomail: could not send email 1: 554 Transaction failed: Expected '/', got ;
Error: gomail: could not send email 1: 554 Transaction failed: Expected '/', got ;

with config file:

notifications:
  onStart: []
  onSkip: ['email']
  onSuccess: ['email']
  onFailure: ['email']

email:
  fromAddress: "Steve Frank <name@domain>"
  toAddress: "Steve Frank <name@domain>"
  serverHostname: email-smtp.us-east-1.amazonaws.com
  serverPort: 587
  authUsername: ID [these are correct in test]
  authPassword: KEY

I don't know much about SES (never heard of it before now). Any ideas of what the problem may be?

mbafford commented 5 years ago

I think the issue is due to using "text" as the contentType parameter for the call to SetBody. I tested and modified the project @jeffaco is referencing to use "text/plain" for SetBody, and it resolves the issue with my personal SES account.

https://github.com/jeffaco/duplicacy-util/issues/36