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.

We're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Email: From Name

Go to End

5 Posts   2608 Views


Community Member, 197 Posts

9 July 2009 at 12:27pm

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 <>" ?

$email = new Email($from, $to, $subject, $body);


Forum Moderator, 5523 Posts

9 July 2009 at 6:41pm

Chances are new Email(Foo Bar<>, .... ) will work fine :)


Community Member, 98 Posts

29 October 2009 at 1:54am

Edited: 26/11/2009 12:26am

It's not working for me. It seems somewhere along the line extra angle brackets are added.

e.g. "Joe Bloggs <>" is becoming "<Joe Bloggs <>>" and the server throws the following:

[Warning] mail() [function.mail]: SMTP server response: 501 <Joe Bloggs <>>: "@" or "." expected after "Joe"

Anyone else got this problem and/or a workaround?


Community Member, 21 Posts

9 March 2011 at 7:46am

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 <>\'" when setting the from address like:

$from = "From Name <>";



Community Member, 21 Posts

9 March 2011 at 8:56am

Just kidding! For me it was because I was using PHPMailer instead of the built-in mailer. Easily fixed.