How can I customize the sender's name by sending a message in PHP please teach the teacher, how to solve

Source: Internet
Author: User
How can I customize the sender's name by sending a message in PHP please advise the teacher.
Please instruct the teacher to add code to customize the sender name.

For example

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

------Solution--------------------
Think about, with the fromemail must have from the head, you see this sendmail function, inside there is no set request header.
From the head to get into
PHP code
from: Sender Name "sender email address" 
  • Related Article

    Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.