PHP Mailer failing with Warning: preg_match(): Compilation failed

Image for PHP Mailer

No doubt in excellence of PHP Mailer library for sending mails, but sometimes library do give a setback when it comes to its compatibility with earlier versions of PHP.

If you have encountered with below error it is do with PHP Mailer’s incompatibility with PHP 5.3 and below.

Warning: preg_match(): Compilation failed: reference to non-existent subpattern at offset 10 in /home/mattoc59/domains/XXXXXX/public_html/modelsignup/includes/class.phpmailer.php on line 738

Don’t worry you do not have to look for PHP Mailer script for PHP 5.3, you can just replace the ValidateAddress function in class.phpmailer.php file with following function and boom 😉

About author

Love coding, crazy about logic, like solution architecting and solving problems. Thirsty for knowledge, challenges & most importantly innovation. One of the passionate brain behind SpryOX

Leave a Reply

Your email address will not be published. Required fields are marked *