Getting around mailto / href / url character limit
26,758
Solution 1
Is there a way to get around the limit?
Very hardly.
It is even probable that the limitations vary from browser to browser, or from E-Mail client to E-Mail client.
I would rather use a HTML form and a server-side script to send the message.
Solution 2
Yes, there is a limit on the length of the URL.
The limit varies from browser to browser, so you should keep the URL below 2000 characters to be safe.
Internet Explorer seems to be the browser that is having the shortest limit. According to this article it's 2083 characters.
Related videos on Youtube
Author by
HyderA
Updated on July 09, 2022Comments
-
HyderA almost 2 years
I have a mailto link in an anchor tag
<a href="mailto:?subject=Subject&body=Body">Email This</a>
The issue is that the Body parameter is a huge article, and there appears to be a character limit on the url.
Is there a way to get around the limit?
-
HyderA over 13 yearsI don't want to email the message. I want it to work like a regular mailto link, where the user can send an email via their mail client.
-
Pekka over 13 years@gAMBOOKa I see. You may be out of luck for that... Maybe send a link to the information instead?
-
HyderA over 13 yearsYes, i guess an excerpt and a link will have to do. Thanks!
-
VKen over 11 yearsThe answer seems similar to others that are already posted and is not very useful. Do you have more details to add?
-
Spork almost 11 yearsThis also holds for href="" which was a problem for my href="javascript: new Array(.....)" (very long array)
-
HyderA about 6 yearsIt works by splitting the emails listed in
mailto
if the url is too large and callingmailto
manually for each sliced set of emails. This only works if there are too many emails (as opposed a large body asked in the original questions) and it creates multiple email drafts in the mail client. -
HyderA about 6 yearsNo, it will create multiple emails with body parts.