Mailto body text does not populate IE

I use mailto to provide customers with quotes for a product. I am trying to automatically fill out a quote in the body of the email by building the mailto link as a string and combining the quotation data in the following code:

var quoteinfo = 'quote information here';
var link = '<a href="mailto:email?subject=subject&body=Please enter your contact information 
and message here: %0A%0A%0AQuote:%0A' + quoteinfo + '">email</a>';

However, when using IE, clicking on the link creates an email message, but only text that is explicitly added appears - nothing is stored in the quotinfo variable. I confirmed that the final link contains all the information about the quote - it simply does not appear in the letter. Since the letter was successfully generated with part of its text, I do not think that this is a problem of character overflow (and in any case, this happens even with 30 characters in the quotinfo variable.

Perhaps this is a problem specific to the mail client?

One last note: I know well that there is a popular movement for replacing mailto forms - for other reasons, I can’t do this, so please refrain from answering by suggesting that you proceed to the form.

A specific example of how my links will appear is as follows:

mailto:sales@optecinc.com?subject=Submission From Quote Creator &body=Please enter
your contact information and message here: %0A%0A%0AQuote:%0A#17350 - IFW 2-inch -
$829.00%0A
+5
source share
3 answers

The hash symbol (#) has special meaning in URLs (remember the names of the bindings, for example, http: //example.com#TopOfPage ). Replace it with %23.

See W3 URL Encoding Reference

Even better, JavaScript can do this for you using a function encodeURI().

window.onload = function() {
  var eTo = encodeURI("sales@example.com");
  var eSubj = encodeURI("Submission From Quote Creator");
  var eBody = encodeURI("Please enter your contact information and message here: \n\n\nQuote:\n#17350  IFW 2-inch -$829.00\n");

  var email = "mailto:" + eTo + "?subject=" + eSubj + "&body=" + eBody;

  document.getElementById("sales").href = email;
}
<a href="" id="sales">email</a>
Run codeHide result
+7

- . , HTML. , , . , , . ?

:

<html>
  <body>

    <a href="mailto:someone@somewhere.com?subject=subject&body=Please enter your contact information and message here: %0A%0A%0AQuote:%0ARaaaawr">email</a>

  </body>
</html>

( IE9, Outlook2007).

+2

URL (#) Fantabulum , , . Outlook ( ), " " ( "" ).

The Detect and Repair launch fixed a number of issues with similar links on our intranet. Typically, the problem is with a damaged file / setting or with another software connection with Outlook - for example, a Windows update that returns a registry key that was changed by Outlook.

0
source

All Articles