node.js - SendPulse + NodeJS: Attachment Issues -


i've written following nodejs app send email attachment.

the problem is, email attachment

  1. the file named "0"
  2. the file cannot opened word (it says corrupt).

by way, i've tried "attachments_binary" trying use "base64" encoding filereadsync no avail.

any suggestions?

=======================================================================

var fs = require('fs');

var sendpulse = require('sendpulse');

sendpulse.init("{secret}", "{key}", "lite");  var fbuff = fs.readfilesync('c://nodejs//projects//devstat//test.docx', 'base64');      var mailitem = {      html: '<h1>test email</h1>',     text: '',     subject: '[test email]',     from: { name: 'john doe', email: '(name)@gmail.com' },     to: [ { name: 'jane doe', email: '(name)@domain.com' } ],     attachments: [ { 'test.docx': fbuff } ] };  var answergetter = function(data) { console.log(data); }  sendpulse.smtpsendmail(answergetter, mailitem); 


Comments

Popular posts from this blog

'hasOwnProperty' in javascript -

python - ValueError: No axis named 1 for object type <class 'pandas.core.series.Series'> -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -