Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
154 views
in Technique[技术] by (71.8m points)

javascript - Attaching a file in email in html5 web page

I am attaching file in html web app using following code but it is not working

 <div class="email_pot">

<a href="mailto:[email protected]?subject=Enhanced Push-to-Talk&attachments=["js/data.js","js/data.js"]"></a>

</div>

For attach file i use following procedure as it is given below

      {
      "toEmail": "ToAddressEmail"
      ,"toName": "ToAddressName"
      ,"subject": "SubjectLine"
      ,"body":"BodyText"
      ,"bodyHtml":"HTML Body Text"
      ,"attachments":["AttachmentPath","
      AttachmentPath"],"titleColour":"Hex Colour (i.e.FF0000)"
      }
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

So, what's your question? I will assume that you are getting some error when you tried to send the email. I have answered a very similar question before:

According to RFC 2368 you can't add an attachment to a message with the mailto: URL scheme due security reasons:

The user agent interpreting a mailto URL SHOULD choose not to create a message if any of the headers are considered dangerous (...) Only the Subject, Keywords, and Body headers are believed to be both safe and useful.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

56.9k users

...