Skip to content

coocheenin/easymail

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EasyMail version badge

EasyMail is a simple wrapper for the sendmail command. It's provides the easiest way for sending emails from your binaries in Nim.

Installation

Install the package by running:

nimble install easymail

Feel free to test the package before writing any code.

Usage

Note: Only with Linux server distro compatible.

# mailme.nim
import easymail

discard mail("youremail@protonmail.com", "NIM Subject", "Hi, It's EasyMail test message!")

You are able to add extra headers:

# mailme.nim
import easymail

extraHeaders.add("Cc: me@mydomain.com")
extraHeaders.add("X-Mailer: EasyMail v0.1.0")

if mail("youremail@protonmail.com", "NIM Subject", "Hi, It's EasyMail test message!", extraHeaders):
  echo "The command completed successfully!"

Here is a fifth parameter emulate, passing with true value will print all generated headers and body without sending attempt:

# mailme.nim
import easymail

discard mail("youremail@protonmail.com", "NIM Subject", "Hi, It's EasyMail test message!", extraHeaders, true)

Testing

Test the package with:

  nimble test

About

Wrapper for the sendmail command. Written in Nim

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages