Skip to main content
This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.
I see how to set the "from" email address but I do not see how to set the "from" name.
How can I make an email from "Foo Bar <firstname.lastname@example.org>" ?
$email = new Email($from, $to, $subject, $body);
Chances are new Email(Foo Bar<email@example.com>, .... ) will work fine :)
It's not working for me. It seems somewhere along the line extra angle brackets are added.
e.g. "Joe Bloggs <firstname.lastname@example.org>" is becoming "<Joe Bloggs <email@example.com>>" and the server throws the following:
[Warning] mail() [function.mail]: SMTP server response: 501 <Joe Bloggs <firstname.lastname@example.org>>: "@" or "." expected after "Joe"
Anyone else got this problem and/or a workaround?
I'm having this problem too... seems uncommon, since there isn't much on the forum (or the googler) about it. I get an "Invalid email: \'From Name <email@example.com>\'" when setting the from address like:
$from = "From Name <firstname.lastname@example.org>";
Just kidding! For me it was because I was using PHPMailer instead of the built-in mailer. Easily fixed.