Closed ishail closed 8 years ago
I haven't check but it may be in the error message. I will have a look to make it easily accessible.
Getting the reply code is quite easy. When the error is an SMTP error, a *textproto.Error is returned.
So here is how you can get the error code:
if err := d.DialAndSend(m); err != nil {
if te, ok := err.(*textproto.Error); ok {
fmt.Println(te.Code)
}
}
Is there a way to receive a messageId/responseCode returned by SMTP server? Like amazon-ses returns SMTP responses as here : http://docs.aws.amazon.com/ses/latest/DeveloperGuide/smtp-response-codes.html