Are there any libraries that help with receiving email in an Elixir application?

I know there are many different libraries to handle sending mail, but are there anyones for handling receiving of emails ?, im looking to implement something similar to plans@tripit.com, that is i send an email to that address and tripit will parse it and do stuff… is there a library like that ?

thanks in advance

Hi @Jonathan, you might wanna take a look at https://github.com/Vagabond/gen_smtp

4 Likes

There is mail which implements RFC2822 parser. However you still need to handle receiving emails on your own. You probably would like to use some external service with web hooks for receiving, ex. Mailgun has such feature as well as SparkPost, SendGrid, and Mandrill.

3 Likes

thanks for the replys @rodrigues @hauleth, I’ll look into the gen_smtp lib

If you don’t mind reading the incoming e-mail from an IMAP-server, there is also this library: https://github.com/Around25/eximap

2 Likes

I’ll repeat what @hauleth said and assert go with Mailgun or some other provider.

Mailgun makes receiving, and even programmatically routing, a breeze. I used it a few years back to handle RSVPs for my wedding. Far better to deal with a REST/HTTP api than the actual Email protocols

2 Likes

pop3mail receives mail via the Erlang pop3client (a.k.a. Erlpop) from a Pop3-mailserver and decodes the mail.

The readme example shows how to use the elixir API.

1 Like

I wrote Receivex https://hex.pm/packages/receivex that abstracts mail providers for receiving email. Right now Mailgun and Mandrill are supported.

The library is still pretty minimal but worked for me

3 Likes

you can also try mail author lib Mailroom