Files
piratepoet/mailpoet/tests/docker/codeception/wp-56-phpmailer-fix.php
alex-mailpoet 1396a979f5 Fix PHPMailer on WP 5.6 in acceptance tests
[MAILPOET-4481]

Use SMTP in PHPMailer on WP 5.6 because its Docker container
has a misconfigured mail() function (no sendmail or alternative)
2022-07-27 08:50:03 +02:00

24 lines
525 B
PHP

<?php
/*
Plugin Name: MailPoet Testing Fix: Use SMTP In PHPMailer on WP 5.6
Version: 0.1
*/
add_action('phpmailer_init', 'mailpoet_test_phpmailer_use_smtp');
function mailpoet_test_phpmailer_use_smtp($phpmailer) {
global $wp_version;
if (!getenv('CIRCLE_BRANCH') || !preg_match('/^5\.6/', $wp_version)) {
return;
}
$phpmailer->isSMTP();
$phpmailer->Host = 'mailhog';
$phpmailer->SMTPAuth = false;
$phpmailer->Port = 1025;
$phpmailer->Username = '';
$phpmailer->Password = '';
}