Reputation: 101
When I am sending a mail via PHP, I am using the PHPMailer class. However when I send the mail and look at it in Outlook I see that sometimes the raw HTML code is displayed. Anyone know why this could be?
Upvotes: 0
Views: 276
Reputation: 468
Test your html code in HTML validation tool and fix accordingly.
Upvotes: 0
Reputation: 168
I think it's because of the empty space in the opening of the IMG tag.
< img src"{src}" alt="{alt}" />
should probably be:
<img src="{src}" alt="{alt}" />
Upvotes: 2
Reputation: 1177
You have to tell PHPmailer that you are rendering the mail as HTML.
$mail->IsHTML(true);
Upvotes: 2