1

THe html email is receiving as html source code not as readable text. WHy?

<html>
           <head>
                   <title></title>
           </head>
           <body>
                   <p style="text-align: center; ">
                           <span style="color:#ff0000;"><span style="font-size:72px;"><span style="background-color:#00ff00;">A test mail</span></span></span></p>
           </body>
    </html>
1
  • 1
    What does this have to do with php? Commented May 4, 2011 at 12:08

2 Answers 2

5

Probably because you have sent a plain text email into which you've written HTML. There are no shortage of tutorials on writing HTML formatted emails with PHP out there, but make sure you use one that shows you have to write a multipart MIME email rather then plain HTML.

Sign up to request clarification or add additional context in comments.

Comments

0

You need to set the Content-Type to text/html.

2 Comments

@David: That's a separate issue.
It is a separate issue in the same sense that preventing SQL injection vulnerabilities are a separate issue to inserting data into a database. You don't ignore the former when explaining how to do the latter (unless you want people to make sites like w3fools about you).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.