Can't send Emails with attachments with nodemailer
问题 I have the following function for sending emails with attachments using nodemailer, but sometimes It returns error enoent, the file path can't be found even if it exists. Can you tell me where is my mistake? 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)