I'm trying to send the alter the from:
header in my email to match the corporate email standard within my origination. But this involves putting the department of the system within curly brackets.
The email is successfully sent with the header but ignores the department text and brackets within the header.
-Is there a way I can output this header without the brackers being ignored?
$emailBody = "content test";
$subject = 'subject test';
$message = "<html><body>".$emailBody."</body></html>";
$headers = 'From: System (department) <[email protected]>' . "\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
$sendmail = mail('[email protected]',$subject,$message,$headers);
Output:
From: System
Desired Output:
From: System (department)
You need to use double quotes ("
) for name of user if you have spaces (
) before <[email protected]>
.
$headers = 'From: "System (department)" <[email protected]>' . "\r\n";
First email is your code without double quotes and second is my, with double quotes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With