简体   繁体   中英

how to send mail automatically using mailto with attachment from outlook using JavaScript and html

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 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 .

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