views:

51

answers:

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,

+1  A: 

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

zebediah49
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