The email and attachment is successfully sent but the attachment failed to be opened/read!
Here is the code :
let str = Buffer.from("Hello World").toString('base64')
console.log("str",str) //HelloWorlQ==
let info = await transporter.sendMail({
from: 'test5@gmail.com', // sender address
to: "test@gmail.com", // list of receivers
subject:"test", // Subject line
attachments:[
{ // encoded string as an attachment
filename: 'text1.pdf',
content: str,
encoding: 'base64',
contentType: "application/pdf"
}
],
});
Any clue please ?