Home php sending HTML letters

sending HTML letters

Author

Date

Category

Explain, please why HTML does not come in proper format.

mail (
  '[email protected]',
  'Letter from the script'
  '& lt; HTML & GT; & LT; Body & GT; Hi Vasily, how are you? & lt; br / & gt; I can send letters using PHP! And soon I will learn to send letters using PHP with attachments! It will be cool! & Lt; / body & gt; & lt; / html & gt; ',
  "From: [email protected] \ r \ n
  Content-Type: text / html; CHARSET = UTF-8 \ R \ N
  X-Mailer: PHP Mail Script "
)

On the mail, the message comes to the trail. The form:

content-type: text / html; Charset = UTF-8
X-Mailer: PHP Mail Script
& lt; html & gt; & lt; head & gt; & lt; title & gt; vasya, hello & lt; / title & gt; & lt; / head & gt; & lt; body bgcolor = "#effe" & gt; & lt; font color = "Blue" & gt; hello Vasily, how are you ? & lt; br / & gt; & lt; font color = "Green" & gt; I can send letters using PHP! And soon I will learn to send letters using PHP with attachments! It will be cool! & Lt; / font & gt; & lt; / body & gt; & lt; / html & gt;

Answer 1, Authority 100%

Formatting incorrect.

mail (
  '[email protected]',
  'Letter from the script'
  '& lt; HTML & GT; & LT; Body & GT; Hi Vasily, how are you? & lt; br / & gt; I can send letters using PHP! And soon I will learn to send letters using PHP with attachments! It will be cool! & Lt; / body & gt; & lt; / html & gt; ',
  "From: [email protected] \ r \ n"
  . "Content-Type: text / html; charset = utf-8 \ r \ n"
  . "X-Mailer: PHP Mail Script"
)

Try this way. Simply, before Content-Type and X-Mailer not necessary spaces ..

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions