A simple self-hosted email sending HTTP API service using SMTP.
Edit appsettings.json, add STMP account configurations:
{
"Urls": "http://127.0.0.1:8080",
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft": "Warning",
"Microsoft.Hosting.Lifetime": "Information"
}
},
"AllowedHosts": "*",
"Mail": {
"Accounts": [
{
"Token": "should_be_random_generated",
"From": "[email protected]",
"FromName": "The Sender",
"Host": "smtp.exmail.qq.com",
"Port": 465,
"Tls": true,
"Username": "[email protected]",
"Password": ""
}
]
}
}
git clone https://github.com/lideming/mailservice.git
cd mailservice
dotnet run -c Release
docker run -d -v /PATH/TO/SETTINGS.json:/app/appsettings.json yuuza/mailservice
POST /api/mail with JSON body:
interface Mail {
fromName: string;
to: string;
toName: string;
subject: string;
body: string;
bodyType: "text" | "html" | string;
}
Content type
Image
Digest
Size
44.4 MB
Last updated
over 5 years ago
docker pull yuuza/mailservice