zytzagoo / smtp-validate-email

A PHP library for performing email addresses validation via SMTP
GNU General Public License v3.0
445 stars 156 forks source link

Utilizing exceptions to provide informative messages in response. #80

Open kriiv opened 1 year ago

kriiv commented 1 year ago

Package has a good number of granular exceptions:

use SMTPValidateEmail\Exceptions\Exception;
use SMTPValidateEmail\Exceptions\Timeout as TimeoutException;
use SMTPValidateEmail\Exceptions\NoTimeout as NoTimeoutException;
use SMTPValidateEmail\Exceptions\NoConnection as NoConnectionException;
use SMTPValidateEmail\Exceptions\UnexpectedResponse as UnexpectedResponseException;
use SMTPValidateEmail\Exceptions\NoHelo as NoHeloException;
use SMTPValidateEmail\Exceptions\NoMailFrom as NoMailFromException;
use SMTPValidateEmail\Exceptions\NoResponse as NoResponseException;
use SMTPValidateEmail\Exceptions\SendFailed as SendFailedException;

Is there a way to utilize these exceptions to include information about the exact error that occurred and providing that as part of the $results array response?

zytzagoo commented 1 year ago

I'm not sure what exactly you want to achieve, but you should be able to extend and override the class and do whatever you need/want?

If you run into some concrete/exact/specific issue(s) while extending/overriding, do report back!