Simple console app to send mail that listed on text file. Can run on Windows, Linux or macOS!
Canfiguration can be done via appsetting.json
file. You can configure mail server, mail template and variables that can use to replace string on mail template.
Object of SmtpOption
"SmtpOption": {
"Host": "",
"UserName": "",
"Password": "",
"Port": 0,
"EnableSsl": true
}
Array
of object MailOption
"MailOption": [
{
"Subject": "Hello from SendMail",
"Body": "mailtemplate.html",
"IsBodyHtml": true,
"Receiver": "mail_receiver_separate_with_newline.txt"
}
]
Object of key: value
pair
"Variables": {
"FilesHostUrl": "https://your-hosting-files-url.com"
}
-
Provide value for mail server
-
Provide value for mail template with following detail
Subject
: email subjectBody
: body of email, you can use plain text or path of html fileIsBody
: set true if you want send body of email with htmlReceiver
: path of text file which contain email receiver that separated with new line
-
Provide value for variables (optional) to replace some string on provided mail template
-
Run with following command
- Linux or macOS:
$ ./SendMail
- Windows:
Or you can just double-click
> .\SendMail.exe
SendMail.exe
- Linux or macOS:
-
Application running