使用php mailer发送邮件时出现的问题
我已经用php邮件类发送了一封电子邮件。邮件发送成功,但我收到的邮件内容为“logo 1”。我正在使用以下代码。。有人请帮忙吗使用php mailer发送邮件时出现的问题,php,phpmailer,Php,Phpmailer,我已经用php邮件类发送了一封电子邮件。邮件发送成功,但我收到的邮件内容为“logo 1”。我正在使用以下代码。。有人请帮忙吗 <? include_once 'editors/tinymce.php'; $to = 'test@test.com'; $frm = 'test1@test1.com'; $sub = 'Weekly Working Report'; $mail_body = include_once('mail_content.php'); $mailstatus = l
<?
include_once 'editors/tinymce.php';
$to = 'test@test.com';
$frm = 'test1@test1.com';
$sub = 'Weekly Working Report';
$mail_body = include_once('mail_content.php');
$mailstatus = l_mail('', '', $to, '', $frm, '', $sub, $mail_body);
if ($mailstatus == 'ok') {
echo '<center><font color=red style="font-size:14px">Message has been sent Succesfully.....!</font></center><br>';
} else {
echo $mailstatus;
}
?>
$to=”pbvamsi@gmail.com";
$subject=“嘿,相信我!”;
$body=“你好,\n\n你怎么样?\n\n做好事做好事”;
$header=”god@heaven.com";
if(邮件($to、$subject、$body、$header)){
echo(消息已成功发送!);
}否则{
echo(消息传递失败…);
}
我希望这能起作用在创建phpmailer类的对象时使用以下代码
$mail = new phpmailer();
$mail->IsHTML(true);
谢谢您不应该以
$mail\u body=include\u once('mail\u content.php')的形式编写代码>
相反
include_once 'editors/tinymce.php';
$to = 'test@test.com';
$frm = 'test1@test1.com';
$sub = 'Weekly Working Report';
ob_start(); // start output buffering
include_once('mail_content.php');
$mail_body = ob_get_contents(); // get the contents from the buffer
ob_end_clean();
$mailstatus = l_mail('', '', $to, '', $frm, '', $sub, $mail_body);
if ($mailstatus == 'ok') {
echo '<center><font color=red style="font-size:14px">Message has been sent Succesfully.....!</font></center><br>';
} else {
echo $mailstatus;
}
include_once'editors/tinymce.php';
$to$test@test.com';
$frm=test1@test1.com';
$sub=‘每周工作报告’;
ob_start();//启动输出缓冲
包括_once('mail_content.php');
$mail\u body=ob\u get\u contents();//从缓冲区获取内容
ob_end_clean();
$mailstatus=l_邮件(“”、$to、$frm、$sub、$mail_正文);
如果($mailstatus=='ok'){
echo“消息已成功发送…”!
;
}否则{
echo$mailstatus;
}
main_content.php的内容是什么?I“+1”此注释:如果您的邮件发送正确,您的问题在于内容。如果忘记添加HTML标题,也可能是HTML问题
include_once 'editors/tinymce.php';
$to = 'test@test.com';
$frm = 'test1@test1.com';
$sub = 'Weekly Working Report';
ob_start(); // start output buffering
include_once('mail_content.php');
$mail_body = ob_get_contents(); // get the contents from the buffer
ob_end_clean();
$mailstatus = l_mail('', '', $to, '', $frm, '', $sub, $mail_body);
if ($mailstatus == 'ok') {
echo '<center><font color=red style="font-size:14px">Message has been sent Succesfully.....!</font></center><br>';
} else {
echo $mailstatus;
}