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"