node.js - Mailgun - Corrupted pdf attachment -
i sending file using mailgun-js module in nodejs. original file fine, 1 receive corrupted.
i using code below send file. array infos.attachements
contains path , name of files want send.
var file = fs.readfilesync(infos.attachments[0].path), attch = new mailgun.attachment({data: file, filename:infos.attachments[0].name , contenttype: 'application/pdf'}), mailoptions = { from: 'sender address' to: 'receiver address', attachment:[attch], subject: 'some subject', // subject line text: 'text content' }; mailgun.messages().send(mailoptions, function(error, body){...
any idea doing wrong?
Comments
Post a Comment