• Our team is looking to connect with folks who use email services provided by Plesk, or a premium service. If you'd like to be part of the discovery process and share your experiences, we invite you to complete this short screening survey. If your responses match the persona we are looking for, you'll receive a link to schedule a call at your convenience. We look forward to hearing from you!
  • We are looking for U.S.-based freelancer or agency working with SEO or WordPress for a quick 30-min interviews to gather feedback on XOVI, a successful German SEO tool we’re looking to launch in the U.S.
    If you qualify and participate, you’ll receive a $30 Amazon gift card as a thank-you. Please apply here. Thanks for helping shape a better SEO product for agencies!
  • The BIND DNS server has already been deprecated and removed from Plesk for Windows.
    If a Plesk for Windows server is still using BIND, the upgrade to Plesk Obsidian 18.0.70 will be unavailable until the administrator switches the DNS server to Microsoft DNS. We strongly recommend transitioning to Microsoft DNS within the next 6 weeks, before the Plesk 18.0.70 release.
  • The Horde component is removed from Plesk Installer. We recommend switching to another webmail software supported in Plesk.

Issue wp_mail function not working in PHP 7.4.12

AndreasY

Basic Pleskian
Hi,

using the basic script below

Code:
<?php
/**
 * This file can be used to validate that the WordPress wp_mail() function is working.
 * To use, change the email address in $to below, save, and upload to your WP root.
 * Then browse to the file in your browser.
 *
 * For full discussion and instructions, see the associated post here:
 * http://b.utler.co/9L
 *
 * Author:      Chad Butler
 * Author URI:  http://butlerblog.com/
 */

/* 
    Copyright (c) 2012-2015  Chad Butler
    
    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU General Public License, version 2, as
    published by the Free Software Foundation.
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    You should have received a copy of the GNU General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
    You may also view the license here:
    http://www.gnu.org/licenses/gpl.html
*/
 
// Set $to as the email you want to send the test to.
$to = "[email protected]";
 
// No need to make changes below this line.
 
// Email subject and body text.
$subject = 'wp_mail function test';
$message = 'This is a test of the wp_mail function: wp_mail is working';
$headers = '';
 
// Load WP components, no themes.
define('WP_USE_THEMES', false);
require('wp-load.php');
 
// send test message using wp_mail function.
$sent_message = wp_mail( $to, $subject, $message, $headers );

//display message based on the result.
if ( $sent_message ) {
    // The message was sent.
    echo 'The test message was sent. Check your email inbox.';
} else {
    // The message was not sent.
    echo 'The message was not sent!';
}

Results in failure to send mail

If we switch back to PHP version 7.3.42 the wp_mail function works as expected.

Anyhow else seeing this ?

It also failed to work when using version 7.4.11.

Found the below link with others experiencing such an issue when using PHP 7.4 and it was resolved when ammended PHP files were included in the PHP folder


Thanks
 
Back
Top