Silence Errors
Posted: Fri Apr 25, 2008 8:42 pm
How can I silence swift mailer errors? For example, I have a php script that my visitors can use to contact me. They enter 1. Their Email Address and 2. A Message. And it always goes to support@mydomain.com
However, if a visitor inputs an invalid email address, then I get this big error and the page stops loading after it:
You can see my script here: http://www.textadmarket.com/help.php?help=7
However, if a visitor inputs an invalid email address, then I get this big error and the page stops loading after it:
How can I get swift mailer to fail "nicely"?Fatal error: Uncaught exception 'Swift_BadResponseException' with message 'Expected response code(s) [250] but got response [501 <adh>: sender address must contain a domain]' in /home/fluxmar/public_html/extra_pages/swift/Swift.php:250 Stack trace: #0 /home/fluxmar/public_html/extra_pages/swift/Swift.php(310): Swift->assertCorrectResponse(Object(Swift_Events_ResponseEvent), 250) #1 /home/fluxmar/public_html/extra_pages/swift/Swift.php(373): Swift->command('MAIL FROM: <adh...', 250) #2 /home/fluxmar/public_html/extra_pages/emailer.php(43): Swift->send(Object(Swift_Message), 'support@textadm...', Object(Swift_Address)) #3 /home/fluxmar/public_html/content/help/contact.php(19): include('/home/fluxmar/p...') #4 /home/fluxmar/public_html/content/help.php(26): include('/home/fluxmar/p...') #5 /home/fluxmar/public_html/content_loader.php(10): include('/home/fluxmar/p...') #6 /home/fluxmar/public_html/layout.php(87): include_once('/home/fluxmar/p...') #7 /home/fluxmar/public_html/help.php(6): include('/home/fluxmar/p...') #8 {mai in /home/fluxmar/public_html/extra_pages/swift/Swift.php on line 250
You can see my script here: http://www.textadmarket.com/help.php?help=7