Make WordPress Core

Opened 6 years ago

Closed 4 months ago

Last modified 4 months ago

#47827 closed defect (bug) (worksforme)

wp_notify_moderator email error when Site Language is fr_CA

Reported by: zzzz4's profile zzzz4 Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Mail Keywords:
Focuses: Cc:

Description

WordPress version: 5.2.2
PHP version: 5.6.27
Hosting: GoDaddy

"Please moderate:" email is sent without issue when Site Language is en_US.
However, when Site Language is fr_CA, the following error occurs:

[04-Aug-2019 01:51:40 UTC] WP_Error Object
(
    [errors] => Array
        (
            [wp_mail_failed] => Array
                (
                    [0] => Could not instantiate mail function.
                )

        )

    [error_data] => Array
        (
            [wp_mail_failed] => Array
                (
                    [to] => Array
                        (
                            [0] => wpadmin@example.com
                        )

                    [subject] => [WPSite] Demande de modération pour « Foo »
                    [message] => Un nouveau commentaire sur l’article « Foo » attend votre approbation
http://blog.example.com/foo/

Auteur : JoeUser (adresse IP : xx.xx.xxx.xxx, joe.example.com)
Adresse courriel : joe_user@example.com
Adresse web : 
Commentaire : 
Commentaire en français

L’approuver : http://blog.example.com/wp-admin/comment.php?action=approve&c=12#wpbody-content
Le mettre dans la corbeille : http://blog.example.com/wp-admin/comment.php?action=trash&c=12#wpbody-content
Le marquer comme indésirable : http://blog.example.com/wp-admin/comment.php?action=spam&c=12#wpbody-content
En ce moment, 4 commentaires attendent vos approbations. Veuillez vous rendre sur le panneau de modération :
http://blog.example.com/wp-admin/edit-comments.php?comment_status=moderated#wpbody-content

                    [headers] => Array
                        (
                        )

                    [attachments] => Array
                        (
                        )

                    [phpmailer_exception_code] => 2
                )

        )

)

Change History (3)

#1 @mattumd
6 years ago

There are few possible reasons:

1- check out your mail server settings. There might be a settings for language. Also, look at below link for similar error:
https://stackoverflow.com/questions/1297084/phpmailer-error-could-not-instantiate-mail-function

2- Check if you mail plugin has language or language encoding settings

3- If none works, either re-install your plugin or change your plugin. You can also look around to see if someone else in French language using the same plugin without any issue, meaning it might be a bug in the mail plugin itself.

Good luck

Matt
https://coding-bootcamps.com/
https://myhsts.org/
https://dcwebmakers.com/

#2 @SirLouen
4 months ago

  • Resolution set to worksforme
  • Status changed from new to closed

Reproduction Report

Description

❌ This report can't validate that the issue can be reproduced.

Environment

  • WordPress: 6.9-alpha-60093-src
  • PHP: 8.2.29
  • Server: nginx/1.29.0
  • Database: mysqli (Server: 8.4.5 / Client: mysqlnd 8.2.29)
  • Browser: Chrome 138.0.0.0
  • OS: Windows 10/11
  • Theme: Twenty Twenty-Five 1.3
  • MU Plugins: None activated
  • Plugins:
    • Testing Dolly
    • Test Reports 1.2.0

Testing Instructions

  1. Set my mail server
  2. Switch the WP language to fr_CA (french Canadian)
  3. Enable Reglagles > Discussion > Un commentaire est en attente de modération enabled
  4. Send a new comment to a post with a not logged in session
  5. ❌ Moderation email is received as expected

Actual Results

  1. ❌ Error condition is not occurring

Additional Notes

  • Looking at the error, all I can see is that there was a problem sending using mail function in your server, completely unrelated to the fact that fr_CA could be involved.
  • Anyway, because I don't want to be guilty of imprudence I've tested and its not reproducible, below, you can check the Canadian French received raw email
  • For this reason, I'm going to be closing this ticket as worksforme. Feel free to comment back if you happen to find some new reproduction instructions like the ones I've provided so I could test it again and confirm a potential issue.

Supplemental Artifacts

Return-Path: <wordpress@alphabetisierung.at>
Received: from localhost (unknown [172.20.0.1])
        by 3ace0024e0b8 (Mailpit) with SMTP
        for <test@example.com>; Sun, 3 Aug 2025 13:10:47 +0000 (UTC)
Date: Sun, 3 Aug 2025 13:10:47 +0000
To: test@example.com
From: WordPress <wordpress@alphabetisierung.at>
Subject: =?UTF-8?Q?[WordPress_Develop]_Demande_de_mod=C3=A9ration_pour_=C2=AB_Hello_world!_=C2=BB?=
Message-ID: <BNS0vRs9UJW1qv2rSWS8MktEO6bB9itmLUPqR6OOoPw@localhost>
X-Mailer: PHPMailer 6.9.3 (https://github.com/PHPMailer/PHPMailer)
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Un nouveau commentaire sur l’article « Hello world! » attend votre approbation
http://localhost:8889/2025/07/23/hello-world/

Auteur : fasdfasdf (adresse IP : 172.20.0.1, 172.20.0.1)
Adresse courriel&nbsp;: fasdfasdf@fdsafdas.com
Adresse web&nbsp;: 
Commentaire&nbsp;: 
fadsfasdfdas

L’approuver&nbsp;: http://localhost:8889/wp-admin/comment.php?action=approve&c=5#wpbody-content
Le mettre dans la corbeille&nbsp;: http://localhost:8889/wp-admin/comment.php?action=trash&c=5#wpbody-content
Le marquer comme indésirable&nbsp;: http://localhost:8889/wp-admin/comment.php?action=spam&c=5#wpbody-content
En ce moment, 4 commentaires attendent vos approbations. Veuillez vous rendre sur le panneau de modération :
http://localhost:8889/wp-admin/edit-comments.php?comment_status=moderated#wpbody-content

#3 @peterwilsoncc
4 months ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.