This is a docker container for expose http port for use self smtp service.
Support two ways to transmit configuration parameters, docker env
or http request body
.
HOST
the mail server smtp service host, eg: smtp.gmail.comPORT
the mail server smtp service port, eg: 465FROM_EMAIL
the sender email address, eg: [email protected]FROM_NAME
the sender name, eg: Order-NotifyPASSWORD
the sender passwordCONTENT_TYPE
the email content type. eg: text/plain; charset=UTF-8SUBJECT
the email subject. eg: Order Notify
Host
the mail server smtp service host, eg: smtp.gmail.comPort
the mail server smtp service port, eg: 465FromEmail
the sender email address, eg: [email protected]FromName
the sender name, eg: Order-NotifyPassword
the sender passwordContentType
the email content type. eg: text/plain; charset=UTF-8Subject
the email subject. eg: Order NotifyToEmail
the receiver email address, eg: [email protected]
docker run -d --restart=unless-stopped --name=smtp-http -p 18081:80 -e HOST=mail.example.com -e PORT=465 xu42/smtp-http
# edit the .env file
docker-compose up -d
curl -H 'content-type: application/json' -X POST "http://127.0.0.1:18081/send" -d '{"fromName":"Order Notify","toEmail":"[email protected]","subject":"Order Notify: New Order","body":"this is a test email"}'
- https://www.cnblogs.com/aaronhoo/p/16364492.html
- https://cloud.tencent.com/document/product/1288/65752
The MIT License (MIT). Please see License File for more information.