-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.js
More file actions
31 lines (26 loc) · 733 Bytes
/
test.js
File metadata and controls
31 lines (26 loc) · 733 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
const nodemailer = require('nodemailer');
function mailsender(){
let transporter = nodemailer.createTransport({
service: 'gmail',
auth: {
user: 'gn1189@srmist.edu.in',
pass: 'python@Khdmdcm34k.'
}
});
// Define email content
let mailOptions = {
from: 'gn1189@srmist.edu.in',
to: 'pythonwithmathi@gmail.com',
subject: 'Test Email',
text: 'This is a test email from Node.js'
};
// Send the email
transporter.sendMail(mailOptions, function(error, info){
if (error) {
console.log(error);
} else {
console.log('Email sent: ' + info.response);
}
});
}
mailsender();