Sign inSign up

yuuza/mailservice

By yuuza

Updated over 5 years ago

Image
0

145

yuuza/mailservice repository overview

Mailservice

A simple self-hosted email sending HTTP API service using SMTP.

Configuration

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": ""
      }
    ]
  }
}

Run from source code

git clone https://github.com/lideming/mailservice.git
cd mailservice
dotnet run -c Release

Run in Docker

docker run -d -v /PATH/TO/SETTINGS.json:/app/appsettings.json yuuza/mailservice

API Usage

POST /api/mail with JSON body:

interface Mail {
    fromName: string;
    to: string;
    toName: string;
    subject: string;
    body: string;
    bodyType: "text" | "html" | string;
}

Tag summary

Content type

Image

Digest

Size

44.4 MB

Last updated

over 5 years ago

docker pull yuuza/mailservice