I suggest that you seriously consider outsourcing your email services. I also studied the creation of such a service for my webapps, but there are many things that you will need to keep on top of this, which will keep your time from your main webapp (unless, of course, you make this service your primary offer). Third party services relieve headaches and routine maintenance.
If you go along this route, you will need to regularly monitor the reputation of your server, maintain relations with whitelists with large Internet providers, monitor and process failures, configure the correct message management for the Internet provider, implement functions such as DKIM, VERP, SPF, etc. Assuming this is for mailing, your main goal is to make sure that every sent message lands in the user's mailbox, and not in the spam box. Be prepared for this in order to devote more time than you understand.
For transactional email (account registration confirmation, account status reports, billing, etc.), check out this SO post for vendors with webapp-compatible APIs.
For email marketing and mass mailing, see the SO post . I just added MailChimp to this list.
source share