DEV Community 👩‍💻👨‍💻

Cover image for How to send mail using npmjs?

Posted on

How to send mail using npmjs?

It's my open source application for send e-mails from static websites

If you like to implement this feature in your static website follow coming steps...

💥 First Step

🎯 Clone from Github that source or install via NPM

npm install @katheesh/mailer-js --save


npm i @katheesh/mailer-js
Enter fullscreen mode Exit fullscreen mode

💥 Second Step

🎯 Set The mailing parameters

    # to = Reciever Email Address 
    # from = Sender Email Address 
    # subject = Email Main Subject 
    # title = This title appear on top of body in h2  
    # body = add this parameter like plain text or html or markdown 

Enter fullscreen mode Exit fullscreen mode

💥 Third Step

🎯 Code like following JavaScript in your js file

var Mailer = require("mailer-js");

var Data = 
    "to": "",
    "subject": "Sample Mail from mailer-js",
    "title": "Sample Mail from mailer-js",
    "body"  : "Hello there,I love coding and proud to present this open source application"
//  Html / Plaintext mailing
console.log(Mailer.prepare(Data)) // i'ts return json format

//  Markdown mailing
console.log(Mailer.prepareMarkdown(Data)) // i'ts return json format
Enter fullscreen mode Exit fullscreen mode

💥 Conclusion

Finally you can send e-mail from your static website. It is a awesome feature and proud of our coding. If you like see this back end API codes contact in comment section.

😍 Have a Awesome day.

Top comments (0)

Become a ModeratorHey! We would love your help!

Fill out this survey and help us moderate our community by becoming a tag moderator here at DEV.