开发者

Confused About MailTo Character Length

I am using mailto in my application to open email templates in outlook, however sometimes I notice my text is truncated. I can't seem to figure out what is the exact length of characte开发者_开发知识库rs I can pass and does limit include the syntax part?

For instance I have

mailto:developer1@kodyaz.com&subject=Mail To Syntax with Samples&body=Hi,%0AIn this article you will find samples about how to use MailTo in HTML

How many characters would the above be? And does %0A count as a single character or 3?

Thanks

Ronita


First, use http://shadow2531.com/js/mailtouri.html to create mailto URIs and make sure you use UTF-8 for your pages.

As for the length issues, that depends on how the mailto URI is being passed to Outlook. If a browser is using ShellExecute() or CreateProcess() for example, the length limit might be a little less than 32K. If system(), is being used, I'm not sure. If the MAPI is used, length probably won't matter at all. However, Outlook might have its own limits.

As for %0D, that would count as 3 characters as far as length limits of the mailto URI go. For a body value, it'd count as one (or two if it's normalized to \r\n). But, not sure if Outlook has a body value limit when the value comes from a mailto URI.

In general though, you shouldn't have a problem.

I'd start testing for the limit by passing mailto URIs of various lengths to outlook.exe to see where the cutoff is. Just make sure the test mailto URIs are properly-encoded and make sure they're properly quoted on the command line.


As per my knowledge there is such restrication apply to mailto tag. Yes there may be some restrication applied by organisation.

%0A will be connsider as single character.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜