gen_smtp: be notified on failed delivery message

Marc Worrell marc@REDACTED
Wed Jan 13 10:25:18 CET 2021


Hi Frank,

Yes, gen_smtp can report failures that happen during communication with the remote smtp server.
Will also report failures if it can’t resolve the domain or find a MX server.

Late bounces (sent by the remote mail agent) must be handled by your own code.

In Zotonic we have an example of handling such bounces.

Check for our mail sending code (which also uses mnesia for queueing):

https://github.com/zotonic/zotonic/blob/master/apps/zotonic_core/src/smtp/z_email_server.erl

And for receiving email, including parsing and handling of bounce messages:

https://github.com/zotonic/zotonic/tree/master/apps/zotonic_listen_smtp/src

Cheers,

Marc


> On 13 Jan 2021, at 09:18, Frank Muller <frank.muller.erl@REDACTED> wrote:
> 
> Hi everyone
> 
> I’m considering using gen_smtp (https://github.com/gen-smtp/gen_smtp <https://github.com/gen-smtp/gen_smtp>) in one of my apps.
> 
> Question: is there a way to be notified on failed delivery message if for example the destination email address was misspelled?
> 
> Thanks
> /Frank

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20210113/1bbf4ef1/attachment.htm>


More information about the erlang-questions mailing list