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”


Leave a Reply

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

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

Facebook photo

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

Connecting to %s