1

I'm trying to create a mailto link using PHP. Basically my function gets the body text from database and then creates the html tag like this:

<a href="mailto:?subject=sample&body=sometexthere">send</a>

well, the problem is that my body text may contain non standard characters, like accents and so, so i need to encode the body text before output it; but i don't know how to do it because when my mail client opens (Windows Live Mail) it displays wrong characters for the body.

How can i solve this? what is the right encoding to use unicode text into the body?

many thanks in advance,

FidoBoy
  • 21
  • 2
  • 4

3 Answers3

2

I beleive you're looking for php's htmlentities() function.

zebediah49
  • 7,467
  • 1
  • 33
  • 50
  • It doesn't work, i've encoded the body text using htmlentities but when i click the link my email client opens and there are wrong caracters instead my accented chars... – FidoBoy Jun 24 '10 at 03:28
0

You have to implement those replacements

http://www.ietf.org/rfc/rfc2368

E Ciotti
  • 4,740
  • 1
  • 25
  • 17
0

Be aware that there seems to be an issue with Outlook if there are non-Ascii characters in sometexthere.

See this post: mailto special characters

Community
  • 1
  • 1
anweibel
  • 485
  • 4
  • 10