Mailto: Guideline and character limitation
Asked Answered
I

2

3

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

Invariable answered 18/9, 2011 at 3:36 Comment(0)
K
4

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?

Kennel answered 18/9, 2011 at 3:43 Comment(0)
E
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.

Enormous answered 7/8, 2012 at 13:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.