.Net Core Email Dispatch MicroService to manage email queue, send reports with domain keys
- Automatic Domain Key creation and signing
- Automatic DNS resolution to find MX records
- Try and connect to best possible MX and cache the result for 5 hours
- Try Sending emails 3 times if there was a network issue
- If server did not accept the message, an exception will be saved in
JobResponse
- Delete all jobs after 7 days
- Save email in blob till the time it is trying to send
- This app uses Eternity Framework, so after crash and restart, it will resume the operations
- You will need azure storage account and you can setup your key in
ConnectionStrings.AzureBlobs
in appsettings.json. - Application Insights must be configured to view the logs.
- Change
AdminPassword
in appsettings.json - Setup
Smtp.Domain
that will be used inHELO/EHLO
command, please make sure you setup correct reverse DNS for the same.
- When you run it, it will open an empty index.html page.
- Open
/swagger
to open API endpoints. - Click on
/api/auth/login
and Try to enter usernameadmin
and password that is configured in appsettings.json - Once you login, you can create new account by clicking
/api/accounts/new
and enter following
{
"id": "unique-alpha-numeric-key",
"selector": "", /// keep same as id
"domainName": "", /// from domain name
"bounceTriggers": "" // [optional] multiple http rest end points for bounce notification separated by new line
}
- Above operation will generate public key for domainkey and auth key for REST Operations
- This will also generate required domainkey with selector, you will need to setup the domain key in your DNS.
- Use AuthKey and id from the account generation process.
- Simple,
api/queue/simple
will accept json to send html/text email. You can post attachments, for this, you will need to use form content type. - Raw, you can use MimeMessage from MimeKit to compose your email in mime format and send it.
- When you send, you will get a job id in
id
field, you can use it to query status of your request.