Escaping Characters in MailTo

I have recently needed to create some more complex mailto links than people normally use.  I need to populate the subject and body with text that is pulled from a DB, so there are lots of random characters in there like @, #, &, -, _, etc…

Most of these won’t work, and need to be escaped.

The most effective way I found was to use the ascii HEX code in this format:

%2D = “-”

%45 = “E”

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s