php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #81615 Windows mail should support internationalized email
Submitted: 2021-11-12 11:00 UTC Modified: 2021-11-30 12:45 UTC
Votes:2
Avg. Score:3.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: gblanchet at cofomo dot com Assigned:
Status: Open Package: Mail related
PHP Version: 8.0.12 OS: Windows
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: gblanchet at cofomo dot com
New email:
PHP Version: OS:

 

 [2021-11-12 11:00 UTC] gblanchet at cofomo dot com
Description:
------------
WHAT I DID:

I try to send an email with non-ASCII characters in it (RFC6530 and the following, see https://en.wikipedia.org/wiki/International_email).

WHAT I WANTED TO HAPPEN:

I wanted to see the support of the EAI protocol, that is, I wanted to see the domain part converted to an A-LABEL and to see the mail function sends the SMTPUTF8 flag.

WHAT ACTUALLY HAPPENED:

The mail is sent as is without transferring the SMTUTF8 flag.

Test script:
---------------
<?php

mail("email-épreuve@épreuve-acceptation-universelle.org", "TEST FROM PHP WINDOWS...", "body");


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2021-11-12 11:44 UTC] heiglandreas@php.net
According to https://php.net/mail the *to*-parameter "must comply with » RFC 2822". Which does not allow anything else than ASCII.

As the SMTPUTF8 flag is defined in RFC6531 which is titled "SMTP Extension for Internationalized Email". Every client and server implementation can, but does not have to, implement it. 

So it is perfectly valid that the mail-function for windows so far does not support Internationalized Email. 

If you need that feature, check out one of the many mail-libraries on https://packagist.org
 [2021-11-15 11:05 UTC] cmb@php.net
-Summary: mail function does not send SMTUTF8 flag when sending internationalized emails +Summary: Windows mail should support internationalized email -Type: Bug +Type: Feature/Change Request
 [2021-11-15 11:05 UTC] cmb@php.net
Changing to feature request per the comment above.
 [2021-11-15 19:21 UTC] gblanchet at cofomo dot com
Thanks a lot for the quick response. I tried some libraries (like PHPMailer), but many seems to not support it. Maybe the PHP native lib could lead the way in this matter? It would be great to have a native mail function supporting internationalization. 

I agree it is more a feature than a bug, though. 

Best regards
 [2021-11-30 12:45 UTC] cmb@php.net
> Maybe the PHP native lib could lead the way in this matter?

Frankly, I doubt that.  Given that the direct SMTP support for
mail() is Windows specific (other systems always use an MTA such
as sendmail, and that is possible on Windows as well), the
moderate amount of work on the implementation[1], and the fact
that implementing this in C is error-prone and unlikely to be much
more efficient than a PHP implementation, it might be preferable
to drop the implementation at all, in favor of userland libraries.

[1] <https://github.com/php/php-src/commits/master/win32/sendmail.c>
 [2023-01-03 12:20 UTC] janettabloomquist at gmail dot com
IT pros, though, will be able to use internationalized addresses in certain Office 365 features, such as "mail flow rules" or "outbound.  Microsoft says that Office 365 will support internationalized email addresses (EAI) in Q1 2018. 
(https://www.surepayroll.us/)github.com
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 18 13:01:27 2024 UTC