Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

How to send pdf attachment with nodemailer?

$
0
0

I have a js file contains the html content.

.js file

const data = (data) => {  return `<h1> This is my pdf data </h1>`}export default data 

This is my nodemailer function

import template from "js_file_path"const body = template(data);const mail = mailcomposer({        from: "XXXX",        to: "XXXX",        subject: `Subject`,        attachments: [          {            filename: "Receipt.pdf",            content: body          }        ]      });      // mail.build()

But this is not working. Can anyone suggest me the way to do this?


Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>