简体   繁体   中英

How to send an email with excel file as attachment in angular-node app

I am working on angular (frontend) and node ( backend). I want to send an email using sendgrid, With excel file as attachment. I followed the app as reference demo app .Instead of downloading the excel, I want the same file to be sent as email attachment.

Note: In the backend I use nodejs, I am not sure how to pass the file with API to node.js, I can send email in nodejs code.

Can someone help me on this?

You can make an http post request in the node api back-end and pass the file. Do post using headers as Multipart form request.

Multipart form request helps you to make the node js api pass the excel sheet generated on the front end.

In your email service add the http service call to the backend. And make the service pass the file in it

Check this link out for more details

https://blog.jscrambler.com/implementing-file-upload-using-node-and-angular/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM