php发送邮件怎样才能自定义发件人名称请老师指教
请老师指教在那添加代码自定义发件人名称
例如
<?php
require '../mail_config.php';
require 'axphp_email.php';
$title=$_POST['title'];
$content=$_POST['content'];
$senddoemain=$_POST['senddoemain'];
$smtpserver = $axphp['server'];
$smtpserverport =$axphp['port'];
$smtpusermail = $axphp['email'];
$smtpuser = $axphp['mailuser'];
$smtppass = $axphp['mailpass'];
$mailsubject = $title;
$mailbody = $content;
$mailtype = "HTML";
$sb=0;
$sendarray=explode(",",$senddoemain);
$emailnum=count($sendarray);
foreach($sendarray as $emaildododo)
{
$smtpemailto = $emaildododo;
$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass);
$smtp->debug = false;
$smtp->sendmail($smtpemailto,$smtpusermail,$mailsubject,$mailbody,$mailtype);
}
;echo '
<script type="text/javascript">
alert(\'您提交邮件数共 ';echo $emailnum;;echo ' 个,成功发送 ';echo $emailnum;;echo ' 个,发送失败 ';echo $sb;;echo ' 个\\n\\n发送成功率: 100%\\n\\n感谢使用阿西在线邮件群发系统!\');location.href=\'admin.php\';</script>';?>
------解决方案--------------------
想了想,有了fromemail肯定有From头,你看这个sendmail函数,里面有没有设置请求头的。
From头要弄成
PHP code
From : 发件人姓名<发件人email地址>