0

I have a html form with upload option onclick of send button want to shoot mail automatically with attachment.i am able to pass subject and body but attachment is not attaching.please help me out thanks

 var link = "mailto:personTO@example.com"+
             "?cc=example@example.com"+
             "&subject=" + escape("Information")+
             "&body=" +body+
             "&attachment="+attachpath;
  window.location.href = link

with above code everything is append to outlook mail except attachment.

  • You cannot attach a file .. check [here](http://stackoverflow.com/questions/14228703/attaching-a-file-in-email-in-html5-web-page) – Sandeep Nayak Jun 24 '16 at 06:46

1 Answers1

0

You can not 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.

mailto: only supports header values or text/plain content.

According to RFC 2368.

user3378165
  • 6,546
  • 17
  • 62
  • 101