D
D
Dmitry Sidorenko2015-11-18 09:27:52
PHP
Dmitry Sidorenko, 2015-11-18 09:27:52

Why does the ZURB email template come to the email without CSS styling?

I use ZURB - zurb.com/playground/responsive-email-templates
Took one of their templates.
If I print a letter before sending, then everything is displayed well (CSS styles are applied):
f1836fa8d7a1437ca87c2c28f75f6342.png
And everything comes to the mail (yandex and gmail) in this form:
16dc0aa759854c109e7c3e83c6f6c2eb.png
CSS styles are lost.
All styles are in the html file, here is the original file - https://yadi.sk/d/i8ksSZgEkXsXb
I send the letter like this:

$subject = 'test';
$msg = file_get_content('zurb.htm');
$headers  = 'MIME-Version: 1.0' . "\r\n";
$headers .= "Content-type: text/html; charset=utf-8 \r\n";
$headers .= "From: [email protected]" . $_SERVER['HTTP_HOST'] . " <[email protected]" . $_SERVER['HTTP_HOST'] . ">\r\n";
$headers .= "Bcc: [email protected]" . $_SERVER['HTTP_HOST'] . "\r\n";
mail($orderModel->email, $subject, $msg, $headers);

Thanks in advance!
Here is one solution to the question: https://github.com/onassar/PHP-Premailer
But it kills the adaptability of the template!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Max, 2015-11-18
@sidorenkoda

Make the styles inline

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question