A tiny .net core microservice to send mails ready in 30 seconds.
AutoMail is a tiny API to send mails based on the MailKit library.
Choose between middleware or api
Install-Package Automail.AspNetCore
Download the last release, drop it to your server and that's it!
All the configuration can be made in environment variable or appsettings.json file
"Automail": {
"Providers": [
{
"Smtp": {
"Host": "smtp.abc.com", // Required
"Port": "587", // Required
"User": "trenoncourt@abc.com",
"Password": "Secret",
"Security": "Tls"
}
},
{
"Path": "xyz", // Can be ommited for 1 endpoint, empty per default
"Smtp": {
"Host": "smtp.xyz.com",
"Port": "587",
"User": "trenoncourt@xyz.com",
"Password": "Secret",
"Security": "Tls",
"LocalDomain": "HELO"
}
}
]
}
"Cors": {
"Enabled": true, // default is false
"Methods": "...", // default is *
"Origins": "...", // default is *
"Headers": "...", // default is *
}
Currently only chose to use IIS integration
"Host": {
"UseIis": true
}
Kestrel options, see ms doc for usage
"Kestrel": {
"AddServerHeader": false
}
storfiler use Serilog for logging, see serilog-settings-configuration for usage
"Serilog": {
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{ "Name": "Console" }
],
"Enrich": ["FromLogContext"]
}
Sends an email.
JSON Body
{
"from": "trenoncourt@abc.fr", // can be omitted if user is in settings
"fromName": "thibaut renoncourt",
"to": "trenoncourt@xyz.com", // required
"subject": "your subject",
"body": "your body",
"cc": "cc@abc.fr",
"isHtml": true
}
FORM-DATA Body
If you want to pass attachments
files: [attachments]
data: same as json body
Note: multiple adresses can be passed with ';' separator
Soon...