I want to be able to receive emails in our .NET project, but how can I do that? I see a lot of tutorials on how to send emails and extract them from an existing server with POP3, but I want to be able to process all mail incoming on our domain example.com, so that I can programmatically create accounts for users.
What I want is:
If anyone could point me in the direction of a tutorial or recommend packages or services that would ease the process, that would be much appreciated. Also, if there would be a 3rd party service that still allows us to receive every email and hande what happens to them, that would also be interesting.
We already use Azure for hosting and SendGrid for sending emails.
I can give you a starter for 10 on this.
You should take a look at the inbound parse documentation: https://sendgrid.com/docs/ui/account-and-settings/inbound-parse/ This allows you to redirect the MX record to Sendgrid and allow it to POST the content to a specified URL.
ANY email will be sent there, so even ones with guid@domain.com will be sent there. You can then slice and dice as needed.
In the spirit of full disclosure, we have it working up to the point of getting the attachments (text/html/email addresses are all picked up) and sent to the DB. We send to a webform which chops up the request, but are currently trying to get StrongGrid working (nuget).
Hope this helps!
Peter
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.