You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pre Req - Input in student sign-up asking for parents Mail Addresses
Installing NodeMailer - npm install nodemailer -- save
Insert this code in app.js (Node JS backend file)
const nodemailer = require("nodemailer")
const transporter = nodemailer.createTransport({
service:"hotmail",
auth :{
user :"[email protected]" ,// example outlook email
pass :"" // password
}
});
const options = {
from:"[email protected]" ,// example outlook mail
to :"[email protected]" ,// recievers mail
subject: "Attendance Record" ,
text : "attendance Record" ,
attachments:[
{ // use URL as an attachment
filename: 'Genrated.xlsx', // File Name
path: 'https://raw.github.com/nodemailer/nodemailer/master/LICENSE' // Example URL
}
]
};
transporter.sendMail(options , function(err,){
if(err){
console.log(err);
return ;
}
console.log("Sent" + info.response)
})
Attach URL of Genrated Excel Sheet to be mailed in path
NOTE - Use only hotmail account at senders end , If new hotmail account use it once before using in the project
Pre Req - Input in student sign-up asking for parents Mail Addresses
Installing NodeMailer - npm install nodemailer -- save
Insert this code in app.js (Node JS backend file)
Attach URL of Genrated Excel Sheet to be mailed in path
NOTE - Use only hotmail account at senders end , If new hotmail account use it once before using in the project
Nodemailer DOCS - https://nodemailer.com/about/
The text was updated successfully, but these errors were encountered: