How to create an email sending service?

I kicked this idea for a while and would like to read your thoughts.

I would like to create a .NET service to send and track email messages.

My rough ideas:

  • In various applications, serialize instances of .NET email objects (System.Net.Mail.MailMessage) and put them in the database or file system queue

  • The postal service / process examines the queue and sends letters

  • Stick to subscription / unsubscribe lists / rules

  • Tracking opens, bounces, auto answers outside the office, etc.

  • Send statuses to source applications

Does anyone have any advice on how I should get started or what problems I may have? Is there any finished software / service that I should look at?

+4
source share
3 answers

You will need to find out everything you can about SMTP, even if you use higher-level tools that do most of the work for you. In my own experience in processing outgoing and incoming emails with .NET, I really did not "understand" until I learned how to connect to port 25 of the SMTP server and send e-mail by issuing the commands themselves.

If you send a large number of emails and you need to track non-delivery reports (non-delivery reports), you will need to set the sender address of the SMTP envelope to your own server and analyze all these letters when they arrive at the figure of what happened.

The System.Net email classes do not allow you to chain MAIL FROM using MTA without also setting the From address in the email header to the same thing, so you will need to use a third-party library like aspNetEmail if you need these addresses.

ListNanny is another tool that is useful for parsing NDR, among other functions.

I'm not sure about serializing MailMessage objects. I think it would be easier to just store individual data items and then create MailMessage objects when you need them.

+4
source

You can find some answers to useful email messages in webapp .

+1
source

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.

+1
source

Source: https://habr.com/ru/post/1277415/


All Articles