How to send email using php with sender name and email address by without server name ?
I want to send email with name : NUMBERONE
and email address : admin@NUMBERONE.com
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From:NUMBERONE(admin@NUMBERONE.com)\r\n";
mail($to, $subject, $message, $headers);
I try above code , it's not send email. How can i do that ?
Example #4 in the documentation for PHP mail() function answers your question.
// Additional headers
$headers .= 'To: Mary <mary@example.com>, Kelly <kelly@example.com>' . "\r\n";
$headers .= 'From: Birthday Reminder <birthday@example.com>' . "\r\n";
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
In your case it should be:
$headers .= 'From: NUMBERONE <admin@NUMBERONE.com>' . "\r\n";
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.