Home > Backend Development > PHP Tutorial > php发送邮件怎样才能自定义发件人名称请老师指教,该怎么解决

php发送邮件怎样才能自定义发件人名称请老师指教,该怎么解决

WBOY
Release: 2016-06-13 13:38:23
Original
1152 people have browsed it

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 '
';?>

------解决方案--------------------
想了想,有了fromemail肯定有From头,你看这个sendmail函数,里面有没有设置请求头的。
From头要弄成

PHP code
From : 发件人姓名 <div class="clear">
                 
              
              
        
            </div>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template