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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

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

No from email address!


Go to End


3 Posts   1011 Views

Avatar
simples

Community Member, 77 Posts

14 September 2012 at 3:15am

Edited: 14/09/2012 8:10pm

Hi,

I have just spent all day trying to track down why an email was not being sent when I clicked on the lost password link using a fresh install after adding source files from http://www.ssbits.com/tutorials/2010/site-members-registering-users-and-allowing-them-to-edit-their-details/.

I am using Version 2.4.7 on WAMP and turns out that I could solve it by adding the following line to mysite/code/_config.php.

Email::setAdminEmail($_SERVER['SERVER_ADMIN']);

This set the from address in the list of parameters sent to the 'send' function in Email.php. Without this 'from' is not set and no email is sent with no error message to say why.

Did I miss something obvious here? I ask this because people must be hitting this issue a lot - or I have overlooked something obvious and my solution is not appropriate.

Avatar
martimiz

Forum Moderator, 1391 Posts

14 September 2012 at 11:56pm

There can be many reasons why an e-mail is never sent, or sent but never received. I always make sure, if I can, that the sender e-mailaddres has the same domain name as the website, and that it is an existing e-mail address, most times this is enough to satisfy even very strict emailproviders. So setting the admin email is definitely a good idea. Something like noreply@xxxx.

But there are other considerations as well and other people might explain things far better then I evr could... Example: for one of my testservers only one domain name is acepted by the smtp server I use, its admin person being very very cautious... :)

Avatar
simples

Community Member, 77 Posts

15 September 2012 at 12:12am

Hi martimiz,

Thank you for the tips.