Swiftmailer Swift_Validate

Hi,

is there a way to use Swift_Validate::email($email) in yii?

I get ‘Class ‘frontend\controllers\Swift_Validate’ not found’ error; i tried different configuration with no luck

Any idea?

Thank you!

Hi,

SWIFT_Validate in swift mailer terms is \Swift\Validate.php. As the Mailer.php is creating a new instance of Swift_Mailer (ie \Swift\Mailer class) the routing is taken care. Use as it is used in yii2-swiftmailer\Mailer.php

Thank you

I can’t get it working… in yii2-swiftmailer\Mailer.php there is no validate

I am sorry for complicating your situation with unnecessary information. You could use Swift validate like this any where in your code and it works.




$result = \Swift_Validate::email($email);



Thank you again :) and sorry for my poor knowledge of yii environment :rolleyes: