Receiving Emails

I have never hosted a site before other than dropping a jar file in jelastic.com.I can use Mailchimp,Sendgrid etc. to send emails.But how do I go about receiving emails?Do i have to set up my own email server?I’d really appreciate any help.

web server and email server are two separate things.

often You don’t need to manage a mail server, it is usually done by your domain provider.

NB: and I don’t mean elixir is a web server at all, phoenix is… ( on top of cowboy https://ninenines.eu/ )

@kokolegorille thanks…so if I register a domain with Godaddy,then it means I’ve automatically got a mail server where I can receive mail.Is that correct?

yes, depending on your provider

I’ve been using SendGrid’s WebHooks to receive emails — it parses the incoming emails and then POSTs them to a callback of your choice:

https://sendgrid.com/docs/API_Reference/Webhooks/index.html

thanks @svilen

You could use something like Webmin: http://www.webmin.com which make server admin easier - though you would need to set that up on a fresh server (i.e before everything else as it configures the server in a particular way).

1 Like

thanks @AstonJ…will definitely look into that

1 Like

With gen_smtp (written in Erlang) you can also receive emails directly as it includes a basic smtp server implementation. So if you are receiving emails on a specific domain (or have your regular email destination fwd emails to your aplpication), you can just have it delivered right to your app. There are some Elixir wrappers for gen_smtp such as https://github.com/kamilc/mailman which includes things such as Mailman.LocalSmtpAdapter which make that side of things pretty straight-forward.

The gen_smtp wrapper libs also tend to include email parsers so once received you can turn those emails into handy little Elixir data structures.

Not always the answer, but it is an interesting option!

3 Likes

thanks @aseigo

mailibex is very nice, it uses gen_smtp

I personally prefer to have somebody else deal with setting up and maintaining the mail server, then from Elixir use pop3mail to fetch from it.