Tuesday, 16 May 2017

sending email with html attachment as pdf using googleapis

I'm trying to send an email with some html code as a pdf file using google apis on node.js, is that possible?

As far as I know, when using gmail.users.messages.send method, I need to add everything to the raw field, including the attachments. The problem is that there's no example about how to add one...

Based on original messages, I've tried using content-type: multipart/mixed and application/pdf. It creates a mail with only a file called noname without any format and having inside the content of the message, not the content that was supposed to be on the file.

I also tried adding the attachment as part of an array, like nodemailer syntax, but it didn't work.



via amlibtest

No comments:

Post a Comment