user3332590
user3332590

Reputation: 101

HTML code shown in emails sent

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?

enter image description here

Upvotes: 0

Views: 276

Answers (4)

Noman Ghani
Noman Ghani

Reputation: 468

Test your html code in HTML validation tool and fix accordingly.

Upvotes: 0

Shijin TR
Shijin TR

Reputation: 7768

< img should changes to <img

You can check this example

Upvotes: 1

Irdrah
Irdrah

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

gbestard
gbestard

Reputation: 1177

You have to tell PHPmailer that you are rendering the mail as HTML.

 $mail->IsHTML(true);

Upvotes: 2

Related Questions