PHPMALLER和ZURB的电子邮件基础(已经发送的报头)

PHPMALLER和ZURB的电子邮件基础(已经发送的报头),php,html,css,email,Php,Html,Css,Email,我对这两个phpmailer都还是新手,所以我尝试实现设计我的电子邮件模板,并按照文档中的建议做了。电子邮件已成功发送,但我收到此警告和这些客户端->服务器:,它们打印出$mail->Body标记上的所有html代码,而不是在发送电子邮件后重定向到html页面: 警告:无法修改标题信息-标题已由发送 (输出开始于 C:\xampp\htdocs\vendors\phpmailer\class.smtp.php:234) 下面是我的代码: $mail = new PHPMailer; //Tell

我对这两个phpmailer都还是新手,所以我尝试实现设计我的电子邮件模板,并按照文档中的建议做了。电子邮件已成功发送,但我收到此警告和这些
客户端->服务器:
,它们打印出
$mail->Body
标记上的所有html代码,而不是在发送电子邮件后重定向到html页面:

警告:无法修改标题信息-标题已由发送 (输出开始于 C:\xampp\htdocs\vendors\phpmailer\class.smtp.php:234)

下面是我的代码:

$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.gmail.com';
//Turning peer verification off
$mail->SMTPOptions = array(
    'ssl' => array(
        'verify_peer' => false,
        'verify_peer_name' => false,
        'allow_self_signed' => true
        )
    );
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = "email@gmail.com";
//Password to use for SMTP authentication
$mail->Password = "password";
//Set who the message is to be sent from
$mail->setFrom('email@gmail.com', 'Account');
//Set an alternative reply-to address
$mail->addReplyTo($email, $name);
//Set who the message is to be sent to
$mail->addAddress($email, $name);
$mail->isHTML(true);
//Set the subject line
$mail->Subject = 'Test';
$mail->Body = '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><meta name="viewport" content="width=device-width"><title>Title</title></head><body style="-moz-box-sizing:border-box;-ms-text-size-adjust:100%;-webkit-box-sizing:border-box;-webkit-text-size-adjust:100%;Margin:0;box-sizing:border-box;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;line-height:1.3;margin:0;min-width:100%;padding:0;text-align:left;width:100%!important"><style>@media only screen{html{min-height:100%;background:#f3f3f3}}@media only screen and (max-width:596px){.small-float-center{margin:0 auto!important;float:none!important;text-align:center!important}.small-text-center{text-align:center!important}.small-text-left{text-align:left!important}.small-text-right{text-align:right!important}}@media only screen and (max-width:596px){.hide-for-large{display:block!important;width:auto!important;overflow:visible!important;max-height:none!important;font-size:inherit!important;line-height:inherit!important}}@media only screen and (max-width:596px){table.body table.container .hide-for-large,table.body table.container .row.hide-for-large{display:table!important;width:100%!important}}@media only screen and (max-width:596px){table.body table.container .callout-inner.hide-for-large{display:table-cell!important;width:100%!important}}@media only screen and (max-width:596px){table.body table.container .show-for-large{display:none!important;width:0;mso-hide:all;overflow:hidden}}@media only screen and (max-width:596px){table.body img{width:auto;height:auto}table.body center{min-width:0!important}table.body .container{width:95%!important}table.body .column,table.body .columns{height:auto!important;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;box-sizing:border-box;padding-left:16px!important;padding-right:16px!important}table.body .column .column,table.body .column .columns,table.body .columns .column,table.body .columns .columns{padding-left:0!important;padding-right:0!important}table.body .collapse .column,table.body .collapse .columns{padding-left:0!important;padding-right:0!important}td.small-1,th.small-1{display:inline-block!important;width:8.33333%!important}td.small-2,th.small-2{display:inline-block!important;width:16.66667%!important}td.small-3,th.small-3{display:inline-block!important;width:25%!important}td.small-4,th.small-4{display:inline-block!important;width:33.33333%!important}td.small-5,th.small-5{display:inline-block!important;width:41.66667%!important}td.small-6,th.small-6{display:inline-block!important;width:50%!important}td.small-7,th.small-7{display:inline-block!important;width:58.33333%!important}td.small-8,th.small-8{display:inline-block!important;width:66.66667%!important}td.small-9,th.small-9{display:inline-block!important;width:75%!important}td.small-10,th.small-10{display:inline-block!important;width:83.33333%!important}td.small-11,th.small-11{display:inline-block!important;width:91.66667%!important}td.small-12,th.small-12{display:inline-block!important;width:100%!important}.column td.small-12,.column th.small-12,.columns td.small-12,.columns th.small-12{display:block!important;width:100%!important}table.body td.small-offset-1,table.body th.small-offset-1{margin-left:8.33333%!important;Margin-left:8.33333%!important}table.body td.small-offset-2,table.body th.small-offset-2{margin-left:16.66667%!important;Margin-left:16.66667%!important}table.body td.small-offset-3,table.body th.small-offset-3{margin-left:25%!important;Margin-left:25%!important}table.body td.small-offset-4,table.body th.small-offset-4{margin-left:33.33333%!important;Margin-left:33.33333%!important}table.body td.small-offset-5,table.body th.small-offset-5{margin-left:41.66667%!important;Margin-left:41.66667%!important}table.body td.small-offset-6,table.body th.small-offset-6{margin-left:50%!important;Margin-left:50%!important}table.body td.small-offset-7,table.body th.small-offset-7{margin-left:58.33333%!important;Margin-left:58.33333%!important}table.body td.small-offset-8,table.body th.small-offset-8{margin-left:66.66667%!important;Margin-left:66.66667%!important}table.body td.small-offset-9,table.body th.small-offset-9{margin-left:75%!important;Margin-left:75%!important}table.body td.small-offset-10,table.body th.small-offset-10{margin-left:83.33333%!important;Margin-left:83.33333%!important}table.body td.small-offset-11,table.body th.small-offset-11{margin-left:91.66667%!important;Margin-left:91.66667%!important}table.body table.columns td.expander,table.body table.columns th.expander{display:none!important}table.body .right-text-pad,table.body .text-pad-right{padding-left:10px!important}table.body .left-text-pad,table.body .text-pad-left{padding-right:10px!important}table.menu{width:100%!important}table.menu td,table.menu th{width:auto!important;display:inline-block!important}table.menu.small-vertical td,table.menu.small-vertical th,table.menu.vertical td,table.menu.vertical th{display:block!important}table.menu[align=center]{width:auto!important}table.button.small-expand,table.button.small-expanded{width:100%!important}table.button.small-expand table,table.button.small-expanded table{width:100%}table.button.small-expand table a,table.button.small-expanded table a{text-align:center!important;width:100%!important;padding-left:0!important;padding-right:0!important}table.button.small-expand center,table.button.small-expanded center{min-width:0}}</style><table class="body" data-made-with-foundation="" style="Margin:0;background:#f3f3f3;border-collapse:collapse;border-spacing:0;color:#0a0a0a;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;height:100%;line-height:1.3;margin:0;padding:0;text-align:left;vertical-align:top;width:100%"><tbody><tr style="padding:0;text-align:left;vertical-align:top"><td class="float-center" align="center" valign="top" style="-moz-hyphens:auto;-webkit-hyphens:auto;Margin:0 auto;border-collapse:collapse!important;color:#0a0a0a;float:none;font-family:Helvetica,Arial,sans-serif;font-size:16px;font-weight:400;hyphens:auto;line-height:1.3;margin:0 auto;padding:0;text-align:center;vertical-align:top;word-wrap:break-word"><center style="min-width:580px;width:100%"></center></td></tr></tbody></table></body></html>';
if (!$mail->send()) {
   echo "Mailer Error: " . $mail->ErrorInfo;
} else {
   header("Location:login.php?login=success");
   exit();
}
$mail=新的PHPMailer;
//告诉PHPMailer使用SMTP
$mail->isSMTP();
//启用SMTP调试
//0=关闭(用于生产使用)
//1=客户端消息
//2=客户端和服务器消息
$mail->SMTPDebug=2;
//请求HTML友好的调试输出
$mail->Debugoutput='html';
//设置邮件服务器的主机名
$mail->Host='smtp.gmail.com';
//关闭对等验证
$mail->SMTPOptions=array(
“ssl”=>数组(
“验证对等方”=>false,
'verify_peer_name'=>false,
“允许自签名”=>true
)
);
//使用
//$mail->Host=gethostbyname('smtp.gmail.com');
//如果您的网络不支持IPv6上的SMTP
//为经过身份验证的TLS(又称RFC4409 SMTP提交)设置SMTP端口号-587
$mail->Port=587;
//将加密系统设置为使用-ssl(已弃用)或tls
$mail->SMTPSecure='tls';
//是否使用SMTP身份验证
$mail->SMTPAuth=true;
//用于SMTP身份验证的用户名-使用gmail的完整电子邮件地址
$mail->Username=”email@gmail.com";
//用于SMTP身份验证的密码
$mail->Password=“Password”;
//设置要从谁发送消息
$mail->setFrom('email@gmail.com","账户";;
//将替代答复设置为地址
$mail->addReplyTo($email,$name);
//设置要向谁发送邮件
$mail->addAddress($email,$name);
$mail->isHTML(true);
//设置主题行
$mail->Subject='Test';
$mail->Body=Title@media仅屏幕{html{最小高度:100%;背景:{f3f3}}@仅媒体屏幕和(最大宽度:596px){.small float center{margin:0 auto!重要;float:none!重要;text align:center!重要}。small text center{text align:center!重要}。small text left{text align:left!重要}。small text right{text align:right!重要}@仅媒体屏幕和(最大宽度:596px){.hide for large{display:block!重要;宽度:auto!重要;溢出:visible!重要;最大高度:none!重要;字体大小:inherit!重要;行高:inherit!重要}}@media-only屏幕和(最大宽度:596px){table.body table.container.hide for lar,table.body table.container.row.hide-for-large{显示:表格!重要;宽度:100%!重要}@media only screen和(最大宽度:596px){table.body table.container.callout inner.hide for large{display:table cell!重要;宽度:100%!重要}@media only screen和(最大宽度:596px){table.body table.container.show for lar显示:无!重要;宽度:0;mso hide:all;溢出:隐藏}@仅媒体屏幕和(最大宽度:596px){table.body img{width:auto;height:auto}table.body中心{min width:0!important}table.body.container{width:95%!important}table.body.column,table.body.columns{高度:自动!重要;-moz框大小:边框框;-webkit框大小:边框框;框大小:边框框;左填充:16px!重要;右填充:16px!重要}table.body.column.column,table.body.column,table.body.columns.column,table.body.columns.column{左填充:0!重要;右填充:0!重要}table.body.column.table.body.column.column{padding left:0!重要;padding right:0!重要}td.small-1,th.small-1{显示:内联块!重要;宽度:8.33333%!重要}td.small-2,th.small-2{显示:内联块!重要;宽度:16.6666667%!重要}td.small-3,th.small-3{显示:内联块!重要;宽度:25%!重要}td.small-4,th.small-4{显示:内联块!重要;宽度:33.33333%!重要}td.small-5,th.small-5{显示:内联块!重要;宽度:41.66667%!重要}td.small-6,th.small-6{显示:内联块!重要;宽度:50%!重要}td.small-7,th.small-7{显示:内联块!重要;宽度:58.33333%!重要}td.small-8,th.small-8{显示:内联块!重要;宽度:66.66667%!重要}td.small-9,th.small-9{显示:内联块!重要;宽度:75%!重要}td.small-10,th.small-10{显示:内联块!重要;宽度:83.33333%!重要}td.small-11,th.small-11{显示:内联块!重要;宽度:91.66667%!重要}td.small-12,th.small-12{显示:内联块!重要;宽度:100%!重要}列td.small-12、.列th.small-12、.列td.small-12、.列th.small-12、.列th.small-12{显示:块!重要;宽度:100%!重要}表体td.small-offset-1,表体th.small-offset-1{左边距:8.33333%!重要;左边距:8.33333%!重要}table.body td.small-offset-2,table.body th.small-offset-2{左边距:16.66667%!重要;左边距:16.66667%!重要}table.body td.small-offset-3,table.body th.small-offset-3{左边距:25%!重要;左边距:25%!重要}table.body td.small-offset-4,table.body th.small-offset-4{左边距:33.33333%!重要;左边距:33.33333%!重要}table.body td.small-offset-5,table.body th th.small-offset-5{左边距:41.66667%!重要;左边距:41.6666667%!重要}table.body td.small-offset-6,table.body th.small-offset-6{重要;左边距:50%!重要}table.body td.small-offset-7,table.body th.small-offset-7{左边距:58.33333%!重要;左边距:58.33333%!重要}table.body td.small-offset-8,table.body th.small-offset-8{左边距:66.6666667%!重要}table.body td.small-offset-9,table.body th-offset-9{左边距:75%!重要;左边距:75%!重要}表体td.small-offset-10,表体th.small-offset-10{左边距:83.33333%!重要;左边距:83.33333%!重要}表体td.small-offset-11,表体th.small-offset-11{保证金