javascript - Node.js Nodemailer does not generate attachment content -


i'm trying automate emails nodemailer. problem can't attachments work. here's sample script

var mailoptions = {     from: 'apples@gmail.com', // sender address     to: newclient.a22, // list of receivers     cc: manageremail, // list of receivers     bcc: financeemail, // list of receivers     subject: newclient.a4 + ' |' + monthofservice +' | revision id: '+revisionid, // subject line     html: printoutfile.replace(/(\n)/g, '<br>'),     attachments : [ {   // utf-8 string attachment           filename: 'check.txt',           contents: 'checking attachments work...'       }]  }; 

everything works except attachment parts. filename of mailer

any appreciated, thanks

its content not contents. check sample code on nodemailer wesite http://www.nodemailer.com/

var mailoptions = {     from: 'apples@gmail.com', // sender address     to: newclient.a22, // list of receivers     cc: manageremail, // list of receivers     bcc: financeemail, // list of receivers     subject: newclient.a4 + ' |' + monthofservice +' | revision id:'+revisionid, // subject line     html: printoutfile.replace(/(\n)/g, '<br>'),     attachments : [ {   // utf-8 string attachment           filename: 'check.txt',           content: 'checking attachments work...'        }] }; 

Comments