mailto: subject= and body= support in email clients - html

Does anyone know if when sending a html newsletter what kind of support the major email clients have for the subject= and body= parts of the mailto tag?

The behavior varies by both email client and source application. Here's a likely enough example from my own system, using pjp's link.
Send Mail
Mailto link followed within Outlook client successfully fills subject
Mailto link followed in IE successfully fills subject for Outlook client
Mailto link followed in Firefox fails for same Outlook client (subject text remains part of "TO" field)
I tried the same link in HTML emails read by gmail and Yahoo web clients.
Gmail correctly opens a new message with desired subject
Yahoo pre-fills the subject, but truncates at the space ("Hello" only)
That much variation on just one computer makes embedded mailto tricky to use. I bet that's why many email newsletters provide a "View as a web page" link in the header.

I imagine they've got quite good support for it. BUT!! But mailto will be used to send and email FROM the client TO me#somewhere.com . Thats definitely not you sending out a newsletter.
You'll have to send emails from the server, potentially in a background process.
EDIT:
Slight rethink. Are you talking about you using an admin section with a link with multiple TO addresses that will then open an email client to send out your newsletter? In which case, even though the major browsers probably do have decent support, you shouldn't rely on it out in the wild, since its not in the standard (I think), so they are not required to support it.
EDIT AGAIN:
rfc 2368 info in support of my previous edit

Related

Embed JQuery library in HTML file [duplicate]

Is JavaScript supported in an email message?
http://en.wikipedia.org/wiki/Comparison_of_e-mail_clients
Old clients, such as Lotus Notes, Mozilla Thunderbird, Outlook Express, and Windows Live Mail all seem to have supported some sort of JavaScript execution. Nothing else does.
It seems like a bad idea security-wise, so I would expect this to be a feature that won't always be around, even in these clients.
Short answer
No
Descriptive answer
It depends. But the email is not guaranteed to behave in the way you want it to. Different email clients handle JS differently. Most of the newer email clients do not support any of it since it is potentially very dangerous to support script execution in a desktop application which contains so much of your personal info.
I had a use case where I needed to use JS in an email. I tried out on the web client of outlook and desktop client as well, and it turns out outlook just wipes out the script part of your HTML email. There might be some other email client which does support JS execution, but given that you cannot control the client where your email would be viewed in the client machine, it's not a good idea to embed any scripts in the HTML email.
Its advised to keep your HTML email as simple as possible, no JS, and the least CSS you can do with (because, again, different email clients have varying support for CSS as well) eg: outlook's web client was not even recognizing an HTML button tag in the email. I had to use an anchor tag and some CSS on top of it to mimic the display of a button.
Bottom Line - Don't rely on Javascript when working with HTML email content.
No, generally speaking email readers do not allow javascript.
Other answerers have suggested that the answer is "No."
On the other hand, an html attachment will probably get opened in an environment that runs Javascript.
EDIT: It was suggested that I haven't properly answered the question so here goes a more complete effort.
Summary: I would expect that many or most users receiving an html-formatted email containing embedded Javascript will see it run and have run tests to confirm that this is true in some environments. But Javascript WILL be blocked for some users.
The protocols (specifically RFC2854) explicitly address scripting (within the text/html message body type) with the statement that:
In addition, the introduction of scripting languages and
interactive capabilities in HTML 4.0 introduced a number of
security risks associated with the automatic execution of programs
written by the sender but interpreted by the recipient. User
agents executing such scripts or programs must be extremely careful
to insure that untrusted software is executed in a protected
environment.
So the protocols do support Javascript, but which user agents do?
My (ancient) email reader uses a table to specify which viewer software to use for each mimetype, diverting html content to my favorite web browser. Almost all current web browsers support Javascript (and some issue dire warnings when you try to turn it off!) Do modern email agents include internal html interpreters and, if so, is the javascript turned on or off? I've checked documentation on Thunderbird and find that javascript seems to be turned on by default but can be turned off: http://codeverge.com/mozilla.support.thunderbird/simple-html-tags-reference-docume/2030160
I have noticed that some (?many?) users now access their email from a browser directly (webmail is one such platform) rather than running separate email software. All such platforms which I have tested so far do run any Javascript embedded in the html of the email message. However some such environments, depending on user security settings, do not automatically fetch external links (Javascript or pictures or other) and so can only run external Javascript from a file which is included as an attachment to the message. The same would be true of any offline email reader on a device without a current internet connection.
The above applies to javascript embedded in the main message part of the email body. One can also have html explicitly given as an "attachment", which if saved and then opened would be displayed in a web browser, wherein Javascript is available with very high likelyhood. Therefore, one might included a second copy of the javascript enabled email as an html attachement with an alternative text/plain main body and/or tag in the main text/html directing the user to the attachment.
I've been thinking about this because some of my acquaintances insist on sending me "email greeting cards" which consist of a text message directing me to a link which I've found so unsatisfactory that I refuse to even consider loading it just on principle. I have written and sent email greeting cards with interactive graphics and music and even games using embedded javascript and been satisfied with the result.
Therefore, I maintain that the correct answer is "Yes" both on the grounds that the protocols specifically address scripting and on the grounds that all the email agents I personally use ran the Javascript in my test emails.
You aren't going to get executable JavaScript onto a server and into a mail client. But emails DO support links, you can always link to your content within an email.
For most mail clients, no.
No email client support javascript due to security concern
Try to send a mail with this HTML content
<!DOCTYPE html>
<html>
<body>
<button onclick="this.innerHTML=Date()">The time is?</button>
</body>
</html>
It may be, but mail clients won't read it & mail servers may reject it. So leave it out.
Javascript is not supported in emails.
You can view an email with JavaScript working with Windows Live Mail, but can't add JavaScript to a new email you wish to send.
JavaScript also works with saved .eml files.
Mozilla Thunderbird version 60.7.0 can't view or add JavaScript.
(If you save an eml file with Thunderbird, the code will work if file is then loaded with Live Mail)
You can send an email with JavaScript using PHP code.
Some email websites may support it, but the few I used don't. (AOL, uk2.net, GMail)
Short answer: No it is not supported in an email message
Long answer:
I have tested it with two email readers. Outlook (online) and OE Classic. As OE Classic is very outdated (I use it on windows 7), it does support JavaScript and I tested it with an alert button. However, the newer Outlook does not even support buttons, which showed up as plain text. So to conclude JavaScript is only enabled on some, usually older, email readers but not on new ones such as Outlook.

Link to mail server from website

I have an email page on my website with a form and tinyMCE and all that fancy stuff, but I also want to add a couple of links to the popular mail servers such as gmail, yahoo, and hotmail.
I've seen some links that go to the my Microsoft Office Outlook (which I never use), and I've also seen a gmail link that opens up gmail in a new tab with a form already open and a mailto: value already given. Just wondering how this is done if I, lets say, have a mailto: value to send and perhaps a subject and message.
Just to make it clear, I want three or four image links on my page, each one for a different mail server (gmail, yahoo...) and when clicked on, it opens a form partly filled out (a mailto:value and possibly a subject and/or message) fullscreen. Thanks.
It's not going to be easy, as you'll have to integrate with each one of these services. How about going at it a different way? For GMail (at least on Chrome) you can figure the web app as the handler for your mailto: links. With that, you can create a link that opens GMail, optionally with subject and body filled in. See RFC2368 for details, or try this link.
Most users don't have accounts on all of the web mail services you mentioned anyways, and using the mailto link allow the mail to the sent using the user's default e-mail client (may it be Outlook, or GMail) which most people prefer anyways.

Mailto action with explorer 9 - blank email

I have an html form that I'm sending to external customers so they can fill up and send it back to me.
The problem occurs when they click the submit button on the form.
For some reason in windows 7 64 bit, with outlook 2010 and explorer 9, mailto action doesn't work for me.
An empty outlook message is displayed and only the subject and recipients are added.
There is no attachment and no body text.
When I change the default browser to FF I receive the text I wanted in the body section instead as an attachment (postdata.att).
I can't use server code cause the html form is sent by outlook to external customers, so asp/php/cgi is irrelevant for me.
The external customers have no access to the organization's intranet and since the html form is sent as an email attachment, it's also not hosted on an internet server.
Does anyone has a solution?
Thanks,
mailto action doesn't work for me.
mailto depends on specific combinations of correctly configured browsers and email clients. It is not suitable for pubic use in an action attribute as support is too poor.
Use a server side process instead. Note that form support in HTML email is also poor, so you should link to a form hosted on the web.
I can't use server code cause the html form is sent by outlook to external customers, so asp/php/cgi is irrelevant for me.
You need to set up a public facing webserver.

Mailto Link Not Working in Hotmail

So I have an html email that I am creating for my company for an email campaign we are going to be sending soon for an organization we represent. It contains 2 primary links, one to email a person at the organization we represent, and one to go to the landing page on the site of the organization. The landing page link works fine, the mailto: link does not when the email is viewed from Hotmail. It works on other clients besides Hotmail including Gmail and Outlook.
This is not because the computer which I am testing on does not have an email client installed. It has Outlook 2010 installed and registered as the mailto application. When mailto links are clicked on other sites (not hotmail) they work great...outlook launches a new message window as it should and fills in the subject and email. When we went to test on Hotmail, it shows the mailto link in the status bar, but no action occurs when you click the link. It's as if the link was not a link at all.
This is the link we are trying to use: (edited slightly for privacy)
<div class="button">Email a Resident Advisor</div>
This is placed within an html table cell. It has some basic css styling applied (all embedded in the html email itself). The button class is just designed to make the link stand out in the email...give it a red border and bold the link.
To be much more clear:
Works:
Gmail - IE9, Chrome, Firefox
Outlook - worked.
Does not work:
Hotmail - All browsers tried
The email was sent using the preview function of CampaignMonitor (handled by our QA guy, I don't have access to it as I'm rather new to the company).
I just need to figure out a way to make this work. Thanks in advance.
Two other programmer and I spent 2 days dealing with this problem earlier this week. I don't have the relevant links handy, but the long and short of the story is that this is a known issue and currently unresolved.
mailto: links will under no circumstance, work in Hotmail, they are removed or something.
We ultimately ended up adding copy instructing recipients to email foo#mail.com in lieu of clicking the link.
Here's a possible solution I found at http://windowsxp.mvps.org/hmposturl.htm that I modified for my purposes. It would require sending unique creative with a custom link to only your Hotmail recipients but it seems to work for me. Here's the href string I used:
http://www.hotmail.msn.com/secure/start?action=compose&to=email#domain.com&subject=My Subject Line&body=Email Body
This is a common problem with most webmail based systems. mailto: doesn't invoke them. Google mailto hotmail and you will find answers for Windows and for specific browsers. I think this will set it up for you
http://email.about.com/od/windowslivehotmailtips/qt/How_to_Make_Windows_Live_Hotmail_Your_Default_Email_Program.htm
Just add target='_blank'...use the 'a' html tag as...
<a href='mailto:Your MAILTO ID' target='_blank'>SOME Support</a>
This works in hotmail client, but it launch new browser instance additionally.
Known problem, I can confirm, is not working on Hotmail web mail only, rest of them work fine, we had the same problem here and we give up trying.
If you really really want that the only way is to use JavaScript, onClick change window location but that introduces a new dependency: JavaScript.

Provide a link to allow users to email our company even if they do not have outlook/outlook express installed

We want to put a link on our site "Subscribe", when you click this link this is the href
href="mailto:subscriber#org.com&subject=i want to subscribe?body=whatever"
This works great, it's super easy too, but the problem is for anyone who does not have outlook/outlook express installed.
Without real development of any new features is it possible to make this work for gmail/yahoo/aol/etc.... email users?
The mailto URL scheme works in all browsers and only in email clients that support it.
In essence, when clicked it will launch the default email client on the computer and set the to address, subject and body.
You can't make it work in a web based email client, since they can't be set as default email clients.
The action that takes place when a user clicks on a "mailto" link is end user dependent.
There's no way with HTML to determine whether or not a client has Outlook or other client apps installed.
You can sidestep all email clients/webmail services if you instead have a form for submitting messages, with a place to put the email address the company should reply to. A simple CGI or PHP script can turn that to an email on the server side.
This page has a PHP example. http://www.w3schools.com/PHP/php_mail.asp