Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WordPress 5.5 deprecates class-phpmailer.php #11

Open
Benunc opened this issue Aug 21, 2020 · 0 comments
Open

WordPress 5.5 deprecates class-phpmailer.php #11

Benunc opened this issue Aug 21, 2020 · 0 comments

Comments

@Benunc
Copy link

Benunc commented Aug 21, 2020

With WP_Debug on, you'll see a notice in 5.5 about deprecated PHP Mailer issues.

For reference, Here's how the Delicious Brains team is handling calling that class now, which includes backward compatibility:

	/**
	 * Gets the PHP Mailer instance.
	 * 
	 * Backwards-compatibility for pre-5.5 versions of WordPress.
	 *
	 * @return PHPMailer
	 */
	public function get_PHPMailer() {
		if ( file_exists( ABSPATH . WPINC . '/PHPMailer/PHPMailer.php' ) ) {
			require_once ABSPATH . WPINC . '/PHPMailer/PHPMailer.php';
			require_once ABSPATH . WPINC . '/PHPMailer/Exception.php';
			$PHPMailer = new \PHPMailer\PHPMailer\PHPMailer();
		} else {
			require_once ABSPATH . WPINC . '/class-phpmailer.php';
			$PHPMailer = new \PHPMailer( true );
		}

		return $PHPMailer;
	}

I briefly tried to fork this plugin and make a PR for that change, but it kept breaking. Hopefully this is enough rails to run on for you to resolve this!

I use email cop on lots of test sites, and love it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant