Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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)"
      }
like image 877
user1808433 Avatar asked Jan 09 '13 05:01

user1808433


2 Answers

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.

like image 175
Tom Sarduy Avatar answered Nov 14 '22 21:11

Tom Sarduy


Whether you can put a file attached to an e-mail depends on the mailer. (but many mailers can't add attachement file from maito:protocol)

I think I was able to put the attachments in some versions of Outlook, perhaps.

like image 44
tenifre Avatar answered Nov 14 '22 21:11

tenifre