I am using SwiftMailer for sending mails and if I try to use dummy email address, for example if I type in “asdf” in email address, I get this uncaught exception.
Fatal error: Uncaught exception 'Swift_RfcComplianceException' with message
'Address in mailbox given [asdf] does not comply with RFC 2822,
I am not very experienced in OO .. so not sure how to handle this? Actually I just want it to fail if the email address is not valid but it shouldnt throw the fatal error message. Any suggestions?
Thanks.
You need to catch the exception, like this
This isn’t an OO thing, it’s an exceptions thing.