【发布时间】:2016-09-18 10:33:43
【问题描述】:
我有一个问题。我已经尝试过使用内联 css 的任何方法,或者我的电子邮件无法读取 css 样式。我已经尽力了,但我仍然不知道问题所在。谁能帮帮我?
$firstname = $row['firstname'];
$to = $email;
$subject = 'Pesan dari kebunbibit';
$message = "<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd'> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> <title>Pesan dari {shop_name}</title> <link href='https://fonts.googleapis.com/css?family=Grand+Hotel' rel='stylesheet' type='text/css'></head> <body> <table class='table table-mail' style='width: 100%; margin-top: 10px; -moz-box-shadow: 0 0 5px #afafaf; -webkit-box-shadow: 0 0 5px #afafaf; -o-box-shadow: 0 0 5px #afafaf; box-shadow: 0 0 5px #afafaf; filter: progidXImageTransform.Microsoft.Shadow(color=#afafaf,Direction=134,Strength=5);'> <tbody> <tr> <td class='space' style='width: 20px; padding: 7px 0;'> </td> <td style='padding: 7px 0;' align='center'> <table class='table' style='width: 100%;' bgcolor='#ffffff'> <tbody> <tr> <td class='logo' align='center'><a style='text-decoration: none; color: #337ff1;' title='{shop_name}' href='{shop_url}'> <img src='{shop_logo}' alt='{shop_name}' /> </a></td> </tr> <tr> <td class='titleblock' style='padding: 7px 0; background-color: #088e64; height:155px;' align='center'><span style='color: #fff; font-family: Open-sans,sans-serif; font-size: small;'> <span class='title' style='font-size: 62px; line-height: 90px; font-family: 'Grand Hotel', cursive;'>Dear Bapak / Ibu $firstname,</span><br /> <span class='subtitle' style='font-size: 40px; line-height: 40px; font-family: 'Grand Hotel', cursive;'>Terimakasih telah berbelanja di {shop_name}<br /> </span></span></td> </tr> <tr> <td class='space_footer' style='padding: 0!important;'> </td> </tr> <tr> <td> <table class='table' style='width: 100%;'> <tbody> <tr> <td style='padding: 7px 0;' width='10'> </td> <td style='padding: 7px 0;'> <p align='center' style='font-size:20px;' data-html-only='1'> <span style='color:#c77501;'>Order</span> <span style='color: #69ad00;'><strong>#{order_name}</strong></span> <span style='color:#c77501'>sudah kami kirim dengan nomor resi</span> <strong><span style='color:#69ad00'>{shipping_number}</span></strong>.</p> <p align='center'> <span style='font-size:20px color: #555454; font-family: Open-sans,sans-serif; '><span style='color: #c77501;'>Status pengiriman bisa dicek di <a style='text-decoration: none; color: #337ff1;' href='{followup}'>{followup}</a> 1 hari setelah email ini diterima, mohon dipastikan ada penerima paket <br> untuk beberapa hari kedepan.</span></span></p></td> <td style='padding: 7px 0;' width='10'> </td> </tr> </tbody> </table> </td> </tr> <tr> <td class='space_footer' style='padding: 0!important;'> </td> </tr> <tr> <td class='box' style='> <table class='table' style='width: 100%;'> <tbody> <tr> <td style='padding: 7px 0;' width='10'> </td> <td style='padding: 7px 0;'> <p align='center' style='text-transform: uppercase; font-size:20px; color:#088e64;'>Penting :</p> </td> <td style='padding: 7px 0;' width='10'> </td> </tr> <tr> <td> <td><img src='https://www.kebunbibit.id/themes/buyshop/mails/img/Mediatanam.png' width='250'><td> <td><a href='http://www.youtube.com/watch?v=X9L7KCQkoWY' target='_blank'><img src='http://kebunbibit.id/themes/buyshop/mails/img/Tutorialvidio.png' width='250'></a><td> <td><a href='https://kebunbibit.id/module/helpdesk/Helpdesk' target='_blank'><img src='https://www.kebunbibit.id/themes/buyshop/mails/img/Bantuan.png' width='250'></a><td> <td><img src='https://www.kebunbibit.id/themes/buyshop/mails/img/Garansitanaman.png' width='250'><td> </td> </tr> </tbody> </table> </td> </tr> <tr> <td class='linkbelow' style='padding: 7px 0;'><span style='color: #555454; font-family: Open-sans,sans-serif;'> <span style='color:#41b501'>Bapak / Ibu dapat melihat status terakhir dari order ini pada bagian</span> <a style='text-decoration: none; color: #337ff1;' href='{history_url}'>'Riwayat Belanja'</a> di <a style='text-decoration: none; color: #337ff1;' href='{my_account_url}'>'Akun Saya'</a> <span style='color:#4f60fd'>pada website kami <a href='https://kebunbibit.id/' style='text-decoration:none; color:4f60fd'>www.kebunbibit.id</a></span> </span></td> </tr> <tr> <td class='space_footer' style='padding: 0!important;'> </td> </tr> <tr> <td class='footer' style='border-top: 4px solid #84c225; padding: 7px 0px; text-align: center;'> <table width='100%'> <tbody> <tr> <td align='center' width='85%'><span style='color: #555454; font-family: Open-sans,sans-serif; font-size: small;'>PT. KEBUNBIBIT PENUH BUNGA | Dusun Tonggolari RT04 RW09 Desa Sidomulyo, Kota Batu - Jawa Timur <br /> Layanan Pelanggan 0341-599399 | SMS CENTER : 08569020300</span></td> <td align='right' width='15%'><a href='http://twitter.com/kebunbibit'><img style='width: 35px; height: 35px; padding-bottom: 2px;' src='http://www.nasa.gov/sites/default/files/images/twitter-icon.png' alt=' /> </a><a href='http://facebook.com/kebunbibit'><img style='width: 35px; height: 35px; padding-bottom: 2px;' src='http://icons.iconarchive.com/icons/danleech/simple/64/facebook-icon.png' alt=' /></a></td> </tr> </tbody> </table> </td> </tr> </tbody> </table> </td> <td class='space' style='width: 20px; padding: 7px 0;'> </td> </tr> </tbody> </table> </body> </html>";
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=iso-8859-1" . "\r\n";
// More headers
$headers .= 'From: kebunbibit.id <noreply@yourwebsite.com>'."\r\n" . 'Reply-To: "Admin" <"admin@kebunbibit.id">'."\r\n";
$headers .= 'Cc: admin@kebunbibit.id' . "\r\n"; //untuk cc lebih dari satu tinggal kasih koma
@mail($to, $subject, $message, $headers);
【问题讨论】:
-
请使用
<! DOCTYPE html>而不是<!DOCTYPE html PUBLIC '-//W3C//DTD HTML 4.01//EN' 'http://www.w3.org/TR/1999/REC-html401-19991224/strict.dtd'> -
@Fil 它不会改变任何东西
-
是的,我的意思是使用html5,这就是为什么, 而不是旧方法,w3schools.com/html/html_intro.asp