No description
Find a file
2019-03-26 19:07:02 +03:00
src deleting useless comment 2019-03-25 13:01:00 +03:00
tests Initial commit 2019-03-25 12:00:12 +03:00
.gitignore Initial commit 2019-03-25 12:00:12 +03:00
COPYING.md Initial commit 2019-03-25 12:00:12 +03:00
easymail.nimble Initial commit 2019-03-25 12:00:12 +03:00
README.md installation section added 2019-03-26 19:07:02 +03:00

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