Skip to content

Simple console app to send mail that listed on text file

Notifications You must be signed in to change notification settings

ahmadtantowi/SendMail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SendMail

Simple console app to send mail that listed on text file. Can run on Windows, Linux or macOS!

Release Build Latest Version

Configuration

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.

Configure Mail Server

Object of SmtpOption

"SmtpOption": {
    "Host": "",
    "UserName": "",
    "Password": "",
    "Port": 0,
    "EnableSsl": true
}

Configure Mail Template

Array of object MailOption

"MailOption": [
    {
      "Subject": "Hello from SendMail",
      "Body": "mailtemplate.html",
      "IsBodyHtml": true,
      "Receiver": "mail_receiver_separate_with_newline.txt"
    }
]

Configure Variables

Object of key: value pair

"Variables": {
    "FilesHostUrl": "https://your-hosting-files-url.com"
}

Hot to Use

  1. Provide value for mail server

  2. Provide value for mail template with following detail

    • Subject: email subject
    • Body: body of email, you can use plain text or path of html file
    • IsBody: set true if you want send body of email with html
    • Receiver: path of text file which contain email receiver that separated with new line
  3. Provide value for variables (optional) to replace some string on provided mail template

  4. Run with following command

    • Linux or macOS:
      $ ./SendMail
    • Windows:
      > .\SendMail.exe
      Or you can just double-click SendMail.exe
  5. Application running

    SendMail Run