-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathextras.html
More file actions
44 lines (40 loc) · 1.23 KB
/
extras.html
File metadata and controls
44 lines (40 loc) · 1.23 KB
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/*
function sendOTP() {
try {
const nodemailer = require('nodemailer');
console.log('Nodemailer found!');
// Do something with nodemailer...
} catch (error) {
alert('Nodemailer not found:', error);
// Alert that nodemailer is not found
alert('Nodemailer not found. Please make sure it is installed.');
}
const email = document.getElementById("email");
window.otp_val = Math.floor(Math.random() * 10000);
let email_body = `<h2>Please complete your signup for Rx-assist using code: ${otpValue}</h2>`
// Create a transporter object using SMTP transport
let transporter = nodemailer.createTransport({
service: 'Yahoo',
auth: {
user: 'rxassist55@yahoo.com',
pass: 'h97T9BUdrww?gsj'
}
});
// Email content
let mailOptions = {
from: 'rxassist55@yahoo.com',
to: email,
subject: 'Rx Assist signup help',
html: email_body,
};
// Send mail with defined transport object
transporter.sendMail(mailOptions, (error, info) => {
if (error) {
alert("Otp could not be sent. Error:", error);
} else {
alert("Otp sent to email " + email);
showOTP();
}
});
}
*/