const sendEmail = require('jwz/mailer/outlook');
const sender = 'sender@outlook.com';
const password = '1234'; // Please note: storing password in plain text is insecure.
const receiver = 'receiver@outlook.com';
const subject = 'Test';
const text = 'This is a test email.'; // Added some content to the body
sendEmail(sender, password, receiver, subject, text);
This code sends an email using the jwz/mailer/outlook/send
library.
The sender provides their Outlook email and password, along with the recipient's email, subject, and message body.
The function sendEmail
then sends the email.
The script imports the jwz/mailer/outlook/send
module to handle email sending through Outlook.
It defines key parameters for sending an email and executes the send function.
sender
: The Outlook email address of the sender.password
: The sender's Outlook password (should be stored securely).receiver
: The email address of the recipient.subject
: The subject line of the email.text
: The body text of the email.sendEmail
function from the required module.sendEmail
function with the necessary parameters.Storing passwords in plain text is not secure. It is recommended to use environment variables to store credentials securely.