php - PEAR MAIL HTML email not well formatted in Hotmail/Yahoo/GMail -


I am using peers to send HTML emails from my website. My email is sent, but when viewed in Hotmail / Yahoo / Gmail, they are not formatted according to CSS when I see them in Windows Live Miles, they look great.

To be more specific, it seems that no idea of ​​CSS has been taken into account (text format, background image, etc.)

Here is the code using email:

  $ headers = array ('from' => $, 'subject' = & gt; $ subject, 'From' = & gt; $ to); Need_once 'Mail.php'; Need_once 'mail / mime.php'; $ Crlf = "\ n"; $ Mime = new Mail_mime ($ crlf); $ Mime- & gt; SetTXTBody ($ plain); $ Mime- & gt; SetHTMLBody ($ htmlText); $ Body = $ mime- & gt; get receive (); $ Headers = $ mime- & gt; Headers ($ headers); $ Mail = Mail :: Factory ("Mail"); $ Send = $ mail- & gt; Send ($ from, $ header, $ body); If (PAR :: ether ($ send)) {$ mail_sent = 0; } And {$ mail_sent = 1; }  

Should I include content-type in the header? I tried, but it did not help.

The $ html text is a variable that is my HTML. This style is inserted into the HTML (not connected to the CSS file).

If someone can tell me why my email is not formatted in the web client, then I will be grateful.

Ziv

You only The rules in the mail can be very simple style, and it should be specified inline and not in the embedded stylesheet. You can read a lot of information here:


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -