I've got a PHP cron script which sends out emails, the body of which includes a particular hyperlink back to the website. Sadly, the hyperlink doesn't display correctly in the email, and doesn't seem to work properly - the actual link part, that is - for the recipient.
The link looks very much like:
http://www.mywebsite.com/index.php?s=activate&id=d83f236af3g123asee(The value of 'id' is an md5 of the user record being activated.)
So far, I've tried including the link in its plain, unaltered form; and I've tried the PHP functions htmlentities(), htmlspecialchars() wi th the result that both the displayed text and the link are corrupted with odd characters ('om/index.php?s¬tivate&id
§d8ae45').
The PHP function urlencode() seems to render a working link, but again, the text displayed in the email message is corrupted with those odd and unwanted characters.
It also seems that I must place a space at the beginning of the link ( "<A HREF='
http://" ), or my mail client just sees "ttp://", which, of course, doesn't work.
And speaking of which, my own mail client is Outlook Express 6, but I can't know what client my users will be using and I need a generic, works-with-most-everything
solution.
My profuse thanks to all that respond.