simple-email-package
v1.0.12
Published
Send email using SMTP
Downloads
4
Readme
Step -1: Install nodemailer
npm install nodemailer
Step -2: Add this code in app.js file
async function main() {
try {
const emailOptions = {
host: 'your-smtp-host',
port: 587,
secure: false,
user: 'your-smtp-username',
pass: 'your-smtp-password',
from: '[email protected]',
to: '[email protected]',
subject: 'Test Email',
text: 'This is a test email sent using the simple-email-package.',
html: '<p>This is a test email sent using the simple-email-package.</p>',
};
await sendEmail(emailOptions);
console.log('Email sent successfully');
} catch (error) {
console.error('Error sending email:', error);
}
}
main();