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 ..