mail-sender-package
v1.0.31
Published
A simple mail sender package which uses nodemailer to send mails
Downloads
11
Maintainers
Readme
Simple Mail Sender using nodemailer
To install:
npm i mail-sender-package
Some Important Points:
- MailSender: Function which will be used to send mail
- passcode: Your app password of your sender mail id(Remember, it is not same as mail id password which is created during creation of id).
- yourmail: Mail from which you want to send mail
- clientmail: Mail of the Receiver
- mailsubject: Subject of the mail body
- contentinhtml: Mail Body(in HTML)
- service: Type of Service used, 'gmail' by default
How to use:
In backend
const MailSender =require("mail-sender-package")
try {
const { passcode, yourmail, clientmail, mailsubject, contentinhtml, service } = req.body;
MailSender(passcode, yourmail, clientmail, mailsubject, contentinhtml, service); // main mail sender function
}
catch (error) {
return res.status(/*[ERROR_CODE]*/).json({ msg: "MESSAGE" });
}
}