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 Exception Handling ?

Go to End

2 Posts   1360 Views


Community Member, 5 Posts

21 May 2011 at 7:14am

I have found a problem, that if the SMTP servers I'm using become unavailable or timeout.
It sends the form that I send an email with into a loop, where it keeps returning to form page on submit.

My question is how the email class handles something like no answer from the SMTP server?
Could really use some hlep with this please


Forum Moderator, 5523 Posts

21 May 2011 at 10:43am

From what I remember is no exceptions will be throw (SS doesn't really use exceptions that much currently), $email->send() will return a boolean based on whether the mail command worked, so you could check to see if that email is returned false (may return true even though it fails later on), Haven't tried it myself.