"how to send attachments to node mailer file not found" Code Answer's
You're definitely familiar with the best coding language TypeScript that developers use to develop their projects and they get all their queries like "how to send attachments to node mailer file not found" answered properly. Developers are finding an appropriate answer about how to send attachments to node mailer file not found related to the TypeScript coding language. By visiting this online portal developers get answers concerning TypeScript codes question like how to send attachments to node mailer file not found. Enter your desired code related query in the search bar and get every piece of information about TypeScript code related question on how to send attachments to node mailer file not found.
how to send attachments to node mailer file not found
function sendEmail(userEmail, htmlString, requestSnap, FIREBASE_WEB) {
fileName = "test.pdf";
folderName = "./" + uuid.v4();
mkdirp(folderName, function (err) {
if (err) console.error(err)
else console.log(folderName + ' folder created!')
});
pdf.create(htmlString + userEmail, options).toFile(folderName + '/' + fileName, function (err, res) { // if the file doesnt exist it will be created
if (err) return console.log(err);
console.log(res);
var transporter = nodemailer.createTransport(smtpTransport({
service: 'Gmail',
auth: {
user: '...',
pass: '...'
}
}));
console.log("\nPATH " + folderName + "/" + fileName);
var mailOptions = {
from: '[email protected]',
to: userEmail,
subject: 'So mail vo pdf-ot',
text: 'Hellow',
attachments: [{
path: folderName + "/" + fileName
}]
};
transporter.sendMail(mailOptions, function (error, info) {
if (error) {
console.log("ERROR kkkk " + error);
} else {
console.log('Email sent: ' + info.response);
console.log("REQUEST SNAP " + JSON.stringify(requestSnap));
}
deleteFolderRecursive(folderName);
});
});
}
Source: stackoverflow.com
All those coders who are working on the TypeScript based application and are stuck on how to send attachments to node mailer file not found can get a collection of related answers to their query. Programmers need to enter their query on how to send attachments to node mailer file not found related to TypeScript code and they'll get their ambiguities clear immediately. On our webpage, there are tutorials about how to send attachments to node mailer file not found for the programmers working on TypeScript code while coding their module. Coders are also allowed to rectify already present answers of how to send attachments to node mailer file not found while working on the TypeScript language code. Developers can add up suggestions if they deem fit any other answer relating to "how to send attachments to node mailer file not found". Visit this developer's friendly online web community, CodeProZone, and get your queries like how to send attachments to node mailer file not found resolved professionally and stay updated to the latest TypeScript updates.