This question already has answers here:
mailto link with HTML body
(10 answers)
Closed 8 years ago.
I can send an email from JavaScript like:
window.location = "mailto:joe#blogs.com&body=Hello world";
And the user's default mail client (which will always be outlook for this purpose) opens with a pre-populated email that they can edit, then send, like this:
Now, I want to style the email to a basic level - adding links, text color, underlining etc.
My intention was to do this by adding HTML markup to the body, like this:
window.location = "mailto:joe#blogs.com&body=<html><body><h1>Hello world</h1></body></html>";
at the very least I expected to see the same result as before, implying that the client does not support that particular tag, but outlook just renders the tags as plain text, like this:
And even though outlook's default format is HTML, I also tried setting the content-type specifically, like this:
window.location = "mailto:joe#blogs.com&subject=hi&body=<html><body><h1>hello world</h1></body></html>&MIME-VERSION=1.0&Content-Type=text/html; charset=ISO-8859-1";
but get the same result as before.
I know the target version of outlook is capable of rendering HTML, because that's the default format, and from within the UI I can embolden, add links, etc, but how do I encode this information in a mailto: link and ensure that outlook renders it (where user settings permit, of course)
The Mailto format does not support HTML emails. Outlook used to allow it before 2003, but to become compliant with the mailto: standard they removed that functionality.
Related
We require the users to reply in a specific format about their problems. Our current application sends an auto-generated mail which has a mailto embedded like this
Contact Application Team
What we want now is to include a table in the embedded "mailto" so that user can describe their problems in much better way. We have tried encoding html inside mailto body, but it gets treated as simple text.
Is there any way to include the table in the mailto body or any better way to improve the interaction.
It is not possible to include HTML in the mailto body, as defined in Section 2 of RFC 2368.
Possible alternate solutions:
Have users type their information into an HTML form and then use PHP (or similar server side language) to send the email
Try to format your email a little bit nicer by adding in some line breaks. You can use %0D (Carriage Return) followed by %0A (Line Feed). Maybe something like this:
Contact Application Team
My web application sends emails to subscribed users.
The email is formatted as an html page and contains html addresses specified as plain text (not inside href tag).
The intent is for the email client to display the html address as simple text, one that the user can "paint" with the cursor and copy to clipboard
This works just fine in some email clients (for example yahoo). However,
other clients (for example, MS outlook and gmail) detect these pieces of text, and display the html address as a link, making it difficult for the user to do the paint-copy-paste described above.
I tried the following:
wrap the text in CDATA block - gmail then disregards the whole block
escape the html address (instead of http://... --> http://...) - makes no difference (still make a link out of text)
any ideas?
you could but a double :: to disable the parsing:
http:<span style="display: none;">:</span>//google.com/
This will not show the second : and should avoid the parsing.
EDIT:
This will work:
http<span>:</span>//google<span>.</span>com/
I'm trying to use an html email signature that pulls the html from another site. So, imagine I have the html hosted at blahblah.com/blah.html, and blah.html is:
<html>
<body>
Jon Jones
jon#blahblah.com
</body>
</html
And then my html signature would be something like <embed src="blahblah.com/blah.html/> that way I can manipulate the signature without having to constantly change the actual signature in Outlook (which I use to check my email).
I can't figure out any html that will do what I'm trying to do. The embed tag that I posted above doesn't do the trick. What simple line of html can I use to say "display what you find at blahblah.com/blah.html"
I would venture a guess and say this isn't the best way to do this.
From a security standpoint, I wouldn't want to be viewing any email sent by you that also brings in somesite.com/signature.htm. Even if it did, it would invoke a "click to view linked elements in this email" banner, and hide it until I did so (but chances are I'm not clicking).
From a recipient stand point, some spam filters block emails with externally-linked content (your intended recipient may not even get your email, or (best-case) see it with [spam] in the subject line.)
If you want an easy up-keep, you could place the signature in your my documents/some other folder and link to it via outlook's settings, but that about the least intense method (while also not causing concerns or issues to anyone viewing your email.)
It looks like instructions for what you want are here: http://www.emailaddressmanager.com/tips/html-email.html
Under "How to add HTML links in Outlook HTML emails," point to blahblah.com/blah.html
On the other hand, HTML in emails is generally not a great thing because it often isn't very secure (you could send me a page with HTML that would load a virus), so many clients won't be able to recieve it or will flag it as spam.
I have an email script written in .Net that sends html emails. The email uses normal html hyperlinks to insert a link in the email, like this:
StackOverflow
The problem is that in Entourage, a hyperlink like this always shows up for me like this:
StackOverflow < http://www.stackoverflow.com/ >
How can I format the hyperlink in my email so that in Entourage the text "StackOverflow" is the actual hyperlink, and the URL is not displayed after the text? Is there an html meta tag that needs to be set? Do I have to set the content-type somewhere? Or is there a different html syntax on the hyperlink itself that I should use?
In emails from some websites a hyperlink such as the one above renders correctly in Entourage, whereas in emails from others it does not. So, what is the difference between the emails sent from these different domains?
I suspect it is something in the meta information. Maybe the DomainKey-Signature?
This question already has answers here:
mailto link with HTML body
(10 answers)
Closed 4 years ago.
I have not had to mess with mailto links much. However I now need to add a link in the body of a mailto if it is possible.
Is there a way to add a link or to change the email opened to an html email vs a text email?
Something like:
Link text goes here
Section 2 of RFC 2368 says that the body field is supposed to be in text/plain format, so you can't do HTML.
However even if you use plain text it's possible that some modern mail clients would render a URL as a clickable link anyway, though.
Add the full link, with:
"http://"
to the beginning of a line, and most decent email clients will auto-link it either before sending, or at the other end when receiving.
For really long urls that will likely wrap due to all the parameters, wrap the link in a less than/greater than symbol. This tells the email client not to wrap the url.
e.g.
<http://www.example.com/foo.php?this=a&really=long&url=with&lots=and&lots=and&lots=of&prameters=on_it>
It isn't possible as far as I can tell, since a link needs HTML, and mailto links don't create an HTML email.
This is probably for security as you could add javascript or iframes to this link and the email client might open up the end user for vulnerabilities.
Please check below javascript in IE. Don't know if other modern browser will work or not.
<html>
<head>
<script type="text/javascript">
function OpenOutlookDoc(){
try {
var outlookApp = new ActiveXObject("Outlook.Application");
var nameSpace = outlookApp.getNameSpace("MAPI");
mailFolder = nameSpace.getDefaultFolder(6);
mailItem = mailFolder.Items.add('IPM.Note.FormA');
mailItem.Subject="a subject test";
mailItem.To = "an#email.here";
mailItem.HTMLBody = "<b>bold</b>";
mailItem.display (0);
}
catch(e){
alert(e);
// act on any error that you get
}
}
</script>
</head>
<body>
Click
</body>
</html>
Here's what I put together. It works on the select mobile device I needed it for, but I'm not sure how universal the solution is
<a href="mailto:me#me.com?subject=Me&body=%3Chtml%20xmlns%3D%22http:%2F%2Fwww.w3.org%2F1999%2Fxhtml%22%3E%3C%2Fhead%3E%3Cbody%3EPlease%20%3Ca%20href%3D%22http:%2F%2Fwww.w3.org%22%3Eclick%3C%2Fa%3E%20me%3C%2Fbody%3E%3C%2Fhtml%3E">
I have implement following it working for iOS devices but failed on android devices
Share This
The specification for 'mailto' body says:
The body of a message is simply lines of US-ASCII characters. The
only two limitations on the body are as follows:
CR and LF MUST only occur together as CRLF; they MUST NOT appear independently in the body.
Lines of characters in the body MUST be limited to 998 characters, and SHOULD be limited to 78 characters, excluding the CRLF.
https://www.rfc-editor.org/rfc/rfc5322#section-2.3
Generally nowadays most email clients are good at autolinking, but not all do, due to security concerns. You can likely find some work-arounds, but it won't necessarily work universally.