Mailto: Guideline and character limitation

10,396

Solution 1

As far as I know there is no limit.

The HTML 4 spec says nothing about a limit

Authors may create links that do not lead to another document but instead cause email to be sent to an email address. When the link is activated, user agents should cause a mail program to open that includes the destination email address in the "To:" field.

To cause email to be sent when a link is activated, specify a MAILTO URL as the value of the href attribute.

http://www.w3.org/TR/WD-html40-970917/struct/links.html#h-13.2.2

However, many sites report a 256 character limit.

You should test to be sure.

You may also find this question and answers illuminating: What is the email subject length limit?

Solution 2

Same problem here, so far no good. IE9 has a limit of around 505 characters per href="...", Chrome 21 is better - around 2000 chars.

Update! According to this guys there is a workaround, and it seems to work for me:

 ClientScript.RegisterStartupScript(this.GetType(), "mailto", 

   "<script type = 'text/javascript'>parent.location='" + longMailtoText + 

   "'</script>") ; 

This will launch the script and open MailClient window as soon as client gets the response. LongMailToText should follow all standard rules, except for length - so far i was able to send over 2000 chars through it.

Share:
10,396
Malcom32
Author by

Malcom32

Updated on June 04, 2022

Comments

  • Malcom32
    Malcom32 almost 2 years

    I'm trying to code an application which will allow users to send emails from outlook using the mailto tag. I know with the mailto, there involves limitation of # of characters that may be passed, as well as encoding.

    Does anyone know the exact count of characters I can use, and what guidelines to follow when it comes to encoding special characters? What is counted in the max number of characters you can use? Body and Subject or the whole line including mailto syntax?

    For example I will have the following:

    <a href='mailto:[email protected]?subject=Test Mail&body=Line one.%0D%0ALine two.'>Test Link</a>
    

    Would this be 69 characters??

    Forgot to mention, supported browser will be IE6.

    Any help would be appreciated.

    Thanks