Home ReactJs - Send Email with email body and attachment
Reply: 0

ReactJs - Send Email with email body and attachment

user5762 Published in September 20, 2018, 12:43 pm

just wondering how we can trigger MS Outlook new mail from client side, using ReactJs. The email should have some content (a table and some texts) in it, also with an attachment (PDF file) downloaded from server side. All the email content can be retrieved from state property 'this.state.data' (it's an array of objects).

Right now I have something below (an html way). When user clicks a button, It can open up new mail screen with subject and SentTo specified. How can I do the rest (content + attachment)?

<button type="button" className="btn btn-default"><a href="mailto:this.guy@gmail.com?subject=Test">Send Out Email</a></button>

For attachment, I need to (probably) write a get method to download from server first. Then how can we attach it to email?

I already know how to download it from server and display it on another tab (it works fine):

  handleDownload = (path) => {
        "/myController/GetFileFromServer?filePath=" + path,

Alternatively, I can also send email via server side, it feels easier for me. However, users likely need to enrich the email manually first before sending. Hence I thought client side would be more suitable for my case.

share|improve this question
  • Just saw this post..seems impossible to attach files in email using mailto..stackoverflow.com/questions/5233556/… – Henrix Feb 14 at 2:57

1 Answer 1

active oldest votes
up vote 0 down vote
You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.470035 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO