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

Popular posts from this blog

python Tkinter Capturing keyboard events save as one single string -

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

javascript - Z-index in d3.js -