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.

General Questions

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

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

Email Exception Handling ?


Reply

2 Posts   926 Views

Avatar
YourMan

21 May 2011 at 7:14am Community Member, 5 Posts

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

Avatar
Willr

21 May 2011 at 10:43am Forum Moderator, 5511 Posts

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.