Closed chrneumann closed 9 years ago
That's ok, thanks! Please name it Bytes() to be consistent with the standard library.
I decided to solve my problem by setting a custom SendMailFunc instead. Thanks anyway!
Any hints to implement this feature? I really want to use this package to send mail with Amazon SES using raw data.
Thanks!
I'm not sure what you want to do, but you could try using a custom SendMailFunc.
For an example, see my SendMailFunc https://github.com/monsti/monsti/blob/master/api/service/monsti.go#L556 and its use here: https://github.com/monsti/monsti/blob/master/core/monsti-daemon/session.go#L144
I think SendMailFunc quite different from my need. AWS allow you to post a raw email message to SES API via HTTP: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/send-email-raw.html
chrneumann is right, that's the best way to do it. A Message instance can represent different raw emails when the Bcc
field is filled. So it cannot simply be exported to a slice of bytes.
Use a SendMailFunc
instead.
It would be nice to be able to export gomail.Message to []byte. I would suggest a function Raw() []byte on Message.
I could implement this and make a pull request.