#54465 closed enhancement (invalid)
Error message with invalid receipent
| Reported by: | sanzeeb3 | Owned by: | |
|---|---|---|---|
| Priority: | normal | Milestone: | |
| Component: | Version: | 5.8 | |
| Severity: | normal | Keywords: | |
| Cc: | Focuses: |
Description
When sending an email with:
wp_mail( 'nameSurname.@gmail.com', 'Subject', 'Message' );
we get the error message: "You must provide at least one recipient email address".
Though the recipient is invalid, it's provided.
Related to: https://core.trac.wordpress.org/ticket/47467 but it does not seem to be fixed.
Change History (2)
Note:
See TracTickets
for help on using tickets.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)
According to the RFC 5322, section 3.4.1, emails starting and ending with a dot are not permitted (
dot-atomformat means,atextwith dots surrounded withatextonly,atextdoesn't include dots (More info about types of tokens)So basically, here is that this address
nameSurname.@gmail.comis not valid.If you check PHPMailer code basically its failing to spot a to, a cc or a bcc because its unable to find a valid address with an @ because of that dot,
Maybe you could find some help with this little workaround: I was able to bypass this by setting the
wp_mail_fromfilter like this:add_filter('wp_mail_from', function($original_email_address) { return 'wordpress@server.local'; });Although using my example code for sending emails:
We can see that this is the result when sending the email:
Return-Path: <wordpress@mailhog.local> Received: from localhost (wordpress-develop-php-1.wordpress-develop_wpdevnet. [172.18.0.3]) by d2756ddb9791 (Mailpit) with SMTP for <nameSurname.@gmail.com>; Sat, 12 Jul 2025 17:25:56 +0000 (UTC) Date: Sat, 12 Jul 2025 17:25:56 +0000 To: nameSurname.@gmail.com From: WordPress <wordpress@server.local> Subject: Subject Message-ID: <nUcLDNeY6tTDsDB3ReQB88Sfd3pQrxN0QRugoMqqR4@localhost> X-Mailer: PHPMailer 6.9.3 (https://github.com/PHPMailer/PHPMailer) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 MessageThe email, although, is being delivered with
wp_maildespite not being compliant. So I don't recommend you using an email like suchClosing this for being
invalidfor not compliant with the RFC.