php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #18798 Mail doesn't sent to "Mary <mary@example.com>" this format
Submitted: 2002-08-08 04:06 UTC Modified: 2002-08-14 08:05 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:0 of 1 (0.0%)
From: karel at publihost dot com Assigned:
Status: Closed Package: Documentation problem
PHP Version: 4.2.3-dev OS: Windows 2k Server SP2
Private report: No CVE-ID: None
 [2002-08-08 04:06 UTC] karel at publihost dot com
If I send an email with the folowing routine I receive the mail.
<?
$to  = "karel@publihost.com";
mail($to, "subject", "message");
?>
OR
<?
$to  = "karel@publihost.com" . ", ";
$to .= "webmaster@publihost.com";
mail($to, "subject", "message");
?>

But If I change the $to varible I don't receive the message.
<?
$to  = "Karel <karel@publihost.com>";
mail($to, "subject", "message");
?>

The same problem occures when I send a message to:
<?
$to  = "Karel <karel@publihost.com>" . ", ";
$to .= "webmaster <webmaster@publihost.com>";
mail($to, "subject", "message");
?>

Is this a problem coused by the mailsoftware (Merak mailserver - http://www.merakmail.com) or is it a php-problem?

Kind regards,
Karel Mertens

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-08-08 06:15 UTC] sander@php.net
Can you test the latest snapshot from http://snaps.php.net, this might have been fixed.
 [2002-08-08 08:05 UTC] karel at publihost dot com
I installed the snap (php4-win32-STABLE-latest.zip - 08-Aug-2002 01:23 4.6M), but the problem remain.
 [2002-08-08 08:25 UTC] sander@php.net
Sorry, should have said that earlier: please try a _non_ STABLE snapshot.
 [2002-08-08 08:33 UTC] karel at publihost dot com
The problem remains I installed the latest snap:
- php4-win32-latest.zip - 08-Aug-2002 03:26 5.3M

If you like I can give you ftp-access to the server.
Then you can try the mail routine yourself.
 [2002-08-11 08:15 UTC] mfischer@php.net
This is a limitation of the mail() command. Adresses in the form of "Something <someone@somewhere.com>" are NOT support by the mail() command.

The technical issue is that mail() does not parsing and while tlaking to the MTA it simple puts the email addresse in '<' and '>' brackets which will then look something like

"<Karel <karel@publihost.com>>"

which of course doesn't work.

You have a two options to me knowledge:
1) trim down the $to field to the user@host.tld part and use the From: custom header
2) Try if the imap_mail() command works for you, afaik it does email address parsing.

Reclassifying as documentation problem for mail() on win32. The page should also mention imap_mail().
 [2002-08-13 20:27 UTC] kalowsky@php.net
This bug has been fixed in CVS. You can grab a snapshot of the
CVS version at http://snaps.php.net/. In case this was a documentation 
problem, the fix will show up soon at http://www.php.net/manual/.
In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites.
Thank you for the report, and for helping us make PHP better.


 [2002-08-14 08:01 UTC] karel at publihost dot com
Fatal error: Call to undefined function: mail_mail() in d:\www\mail.publihost.com\htdocs\test.phtml on line 5

The imap_mail() function is not supported on the Win32 version.
 [2002-08-14 08:05 UTC] sander@php.net
You need to enable php_imap.dll in your php.ini, and use imap_mail().
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Sep 18 20:01:27 2024 UTC