Я использую MAMP (среду разработки стека LAMP) для отправки электронной почты с помощью PHP.php отформатированный html отображается в почте Yahoo, но не gmail
код ниже:
$out_message = '
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>You have requested an appointment with the Smile Zone</title>
</head>
<body>
<p style="font-family:Arial, Helvetica, sans-serif;"><strong>Dear '.$details_name.'</strong></p>
<p style="font-family:Arial, Helvetica, sans-serif">You have requested an appointment!</p>
<p style="padding:10px;"><strong>Please note that this appointment is currently unconfirmed</strong></p>
</body>
</html>
';
//now for the client side:
$out_to = '[email protected]';
$out_subject = 'My Subject';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= "To: John <[email protected]> \r\n";
$headers .= 'From: The Smile Zone <[email protected]>' . "\r\n";
$success2 = mail($out_to, $out_subject, $out_message, $headers);
Когда я отправить это письмо, и вид в Apple Mail, по-видимому, как и должно быть, однако в GMail, в браузере все, что я получаю это сырье источник.
Почему это?
Кроме того, удобная ссылка для форматирования: http://www.campaignmonitor.com/downloads/documents-tools/Campaign_Monitor_Guide_to_CSS_Support_in_Email_27_Aug_2009.pdf К счастью, на этом она не похожа ни на какие проблемы совместимости, но это замечательно ресурс в следующий раз. – bpeterson76