Search code examples
phphtmlxhtmlpear

php email html link, but just showing up as html code


I'm trying to e-mail a html table, that has links within it. But when I receive the e-mail, it just shows me the html code itself.

I'm using PHP pear to send the email.

I try constructing a string like so

$body = "<table>";

$body = $body . "<tr><td><a href='http://google.ca'>Google</a></td></tr>";

$body = $body . "</table>";

then e-mailing it, but when I receive the e-mail, it comes like this

<table><tr><td><a href='http://google.ca'>Google</a></td></tr></table>

Any suggestions? Thanks!


Solution

  • You'll want to ensure you are passing HTML to the setHTMLBody() function. If the problem continues, we'll need to see more of your PHP code.