开发者

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 p开发者_运维技巧ear 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!


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.


It doesn't look like you're setting the Content or MIME-type for HTML email (which means its just being sent in plain text).

Check out this link for a guide on HTML email in PHP: http://articles.sitepoint.com/article/advanced-email-php

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜