mailto links in Gmail - html

I've encountered a problem with Gmail's web application. For some reason, the mailto links doesn't work when I try to add the body into the link. The links works fine as long as the & separator for the body is not used.
For example:
href="mailto:?subject=test&body=this is a test" - Doesn't work
href="mailto:?subject=testbody=this is a test" - Does work but, obviously, it doesn't generate the desired result as everything goes to the subject.
I am running Vista 64bit and I've tried FF, Chrome and IE. Also, I've noticed a difference between how Gmail renders my mail in my Gmail account and Google Apps account.
When i view the same email on my iPhone & Outlook everything seems to work fine.
Any help will be appreciated.

I can get everything to populate on the gmail interface using their full url:
https://mail.google.com/mail/u/0/?view=cm&fs=1&tf=1&to=target#email.com&subject=MISSED%20CALL%20EZTRADER&body=Hello%2C%0A%0AI%20tried%20contacting%20you%20today%20but%20you%20seem%20to%20have%20missed%20my%20call.%20%0A%0APlease%20return%20my%20call%20as%20soon%20as%20you%E2%80%99re%20available.%20%0A%0AIn%20any%20case%2C%20I%20will%20try%20ringing%20you%20at%20a%20later%20time.%0A%0A%0ATy%2C%0A%0A%0A%0A

dude , even if I didn't encoding '&', however I replace followings characters, and then pass the email body and subject to mailto, it does work for me. Hope this may brings you some ideas.
body = body.replaceAll("\\\\", "%5C");
body = body.replaceAll(" ", "%20");
body = body.replaceAll("\r", "%0D");
body = body.replaceAll("\n", "%0A");
body = body.replaceAll("\t", "%09");

Try href="mailto:?subject=test&body=this+is+a+test"

Tested in Firefox 19 - working.
In Chrome you need to install an extension to get it working.
The page I tested - https://dl.dropbox.com/u/60854445/mail.html
Chrome extension - https://chrome.google.com/webstore/detail/mailto-for-gmail/dgkkmcknielgdhebimdnfahpipajcpjn/
Maybe they have fixed it.

try this
Email Me

Consider swapping the spaces for %20.
Also, what is the formatting problem? Or better clarity in all would be helpful. you said "the mailto links doesn't work" and "Gmail renders my mail in my Gmail account and Google Apps account". Is it sending it or not, and if it's sending to both what specifically is the difference.

I was struggling to find out why &subject= doesn't work in href for Gmail.
So I found this &su= to make subject work.
See example below:
href="https://mail.google.com/mail/?view=cm&fs=1&tf=1&to={{test#gmail.com}}&su=Subject&body=Body%20Text"
%20 - space
%0A - new line

As you can see in RFC 2368, this is not possible at all:
The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.

Related

Charcter Limit for Mail to function in Gmail When the body and subject is included

I am trying below function in sending email and same content works fine when i receive email in outlook but when i see in gmail it does not even show the link on the Tag.Can you some body help me how can i fix the issue in Gmail and is there any limit for mailto function in gmail?
Want to approve some but not all repairs in the repair quotation
The standard (mailto protocol) doesn't define a maximum length, leaving implementation up to browsers and mail clients (IETF RFC 2368). But you can find some limitations described for browsers and mail clients on the Effective maximum mailto: body lengths thread.
Also, take a look at the MAILTO max-length of each internet browsers? page.

Outlook adding destination URL in square brackets after hyperlink in HTML e-mail

Bit of a head scratcher here, and I'm still waiting on some details.
The client reported that in Outlook, they are seeing the link in square brackets after the A tag. This apparently just started with the most recent round of e-mails I did for them, but the link code has not changed.
Here is an example of a link :
<p style='margin-bottom:20px !important;' >
Visit MyBlue to log on or register today.
</p>
Here is an image of what they are seeing :
http://rweststaging.com/webmd_emails/example/example.png
I've tested in Litmus, and sent out test e-mails through MailChimp, and I'm not seeing that on any of the outlook versions.
I thought it might be some setting on their particular Outlook install, but they reported only seeing that happen on this particular group of e-mails.
try to add https:// to link in <a> html tag
I had the same problem but in my case part of the url was written with "\", I changed that to "/" and problem was solved-

HTML mailto subject and body display plus sign(+) instead of space in mail client

It's happening in
- Samsung Galaxy Note3 & 4
- Google Chrome browser V39.XX
I am using a link and when click it's launch the mail client
href="mailto:info#gmail.com?subject=Network%20issue"
result: subject=Network+issue
How to remove the plus(+) sign?
Your original approach should work... The only reason that comes to mind behind it not working is perhaps encodings are being mixed up along the way? Take a look at these threads to get a better idea of what I mean:
mailto special characters
Special characters in UTF8 mailto: subject= link and Outlook
I experimented with the base64 approach that is the answer in the second link but was unable to remedy the issue :-\ I tested this on Gmail, Inbox, and Mailbox - all with the same results as what you are describing above.
Maybe something is getting messed up at the Android layer in terms of how the link is being handed off to the mail client of your choice?
If you're rendering using Javascript, try encoding as a URL using encodeURIComponent
const urlEncoded = encodeURI(mailToLink);
before you pass the URL to the mailTo link. Otherwise encode it in the backend first.
This can be done with email addresses that contain special characters too.

mailto link doesn't add Outlook signature in letter

I (and some folks) need to send a lot of similar e-mail's everyday. Using Outlook 2010 as mail client. Today I want to somehow simplify this process.
Thinking about html page with mailto links. Like:
Letter to someone
Letter to someone else
etc...
Problem is come out when I clicked on one of them. Outlooks "New message" window pops up, but without signature. It's only text from mailto link in body.
Can someone point out what I did wrong?
I'm trying to figure this out as well.
According to http://www.experts-exchange.com/Software/Office_Productivity/Groupware/Outlook/Q_26410679.html you get either the body or the signature. I've tested this and removing my body text brought my signature back.
Alternatively, you can hardcode your signature into the body text.
Microsoft is not going to fix this bug. The workaround is to add it in the email body.
I believe the following MSDN article explains what you're describing: Messages that are created outside Outlook do not include the default Outlook email signature (KB 2544665)
Pretty sure you cannot customise a signature from the mailto: link.
The 2 ways to look at it is either setup your signatures in Outlook itself or, add the "signautre" to the bottom of the body included in the link?

How do I stop Gmail from stripping the values out of URLs?

I recently learned that webmail clients like Gmail will do alterations on HTML emails, for example adding target="_blank" to <a> tags.
I've also discovered that other alterations happen as well. When I send an HTML email to Gmail (and possibly other web mail clients) from my PHP script, variable values included in the URL of any links are being stripped out. So, for example, this is the value I'm setting in my PHP code:
$mailContent = '<p><a target="_blank" href="https://example.com/confirmation.html?verification=x1x1x1x1x1x1x1x&email=yyyy#email.com">click here to go to the web site and activate your account!</a></p>';
But when the email is received in Gmail, the HTML code comes out like this:
<p><a target="_blank" href="https://example.com/confirmation.html?verification=&email=">click here to go to the web site and activate your account!</a></p>
The values x1x1x1x1x1x1x1x and yyyy#email.com have been stripped out from within the <a> tag.
How do I protect the values of the variables that I want to pass to the URL so that Gmail won't remove them?
Click View original/source on the message in Gmail to see if the URLs looks like they should then. If so you know that the problem is how Gmail is formatting the message for your viewing. If it's mutilated even in the source I was wondering if there's anything in your webpage/php/CMS (do you use one) that changes the code.
You should try URL-encoding as #Crisp said. Here's the W3 reference.
Emailing in html uses Quoted-printable Encoding. The problem with your $mailContent is that the "=" must be represented by =3D
Try adding this:
$mailContent = quoted_printable_encode($mailContent);
This may not be the perfect answer, but if your application allows for it, I have used URL shorteners a number of times.
http://goo.gl/ is my preferred because the API is super easy to implement and google is very fast. I have a function in a class and I just run my url through it and send the return wherever I need it to be.
Another non-perfect answer here but, my problem was that I was including an http url in the html body and apparently is not valid so I changed them to https. This was on a dev environment so no problem on production.
Here is more info about this:
Any URL's in the body of the mail which lead to insecure sites may also need to be removed. Use https://transparencyreport.google.com/safe-browsing/search to validate these links.. All links should be correctly prefixed with "https". https://en.wikipedia.org/wiki/HTTPS Google seem to be rejecting "http". Sometimes, but not always, removing links from any signature can help.