php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #17541 If specifying a "To:" line in extras it dupliates the addresses
Submitted: 2002-05-31 05:13 UTC Modified: 2002-11-21 17:08 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: liz at xcalibur dot demon dot co dot uk Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.2.1 OS: windows 2000/xp
Private report: No CVE-ID: None
 [2002-05-31 05:13 UTC] liz at xcalibur dot demon dot co dot uk
For the last year Ive been writing a system which heavily relies on Emails. To help people use the system, when it Emails them, it will attach a name to their actual name. EG: Liz Kimber - Authoriser, or Liz Kimber - Requester.

To do that, I use the following code

mail ($toaddr,"Subject","data","From: Purchasing System\nTo: $name - $action <$toaddr>");

Mails used to then arrive as

From: Purchasing System
To: Liz Kimber - Authoriser

Now, they arrive

From: Purchasing System
To: Liz Kimber; Liz Kimber - Authoriser

This code worked marvelously till version 4.2.x :(( this system is due to go live very shortly.  Im trying to win my company over to PHP and I dont want it to look naff as it does. I will have to revert to 4.1.x, but, it would be appreciated if we can get this fixed, or at least if Im being numb, and someone can make this work.. please..

(Mail server is exchange 2000, although I dont think this is relevant)

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-05-31 05:23 UTC] mfischer@php.net
The win32/mail imeplementation suffers many problems. If you need the things working urgent it may be the time to consider moving over to using a non-Win32 system to run your PHP applications.
 [2002-05-31 12:16 UTC] liz at xcalibur dot demon dot co dot uk
Sadly, I cant move them to a non windows one, its bad enough Im not using ASP (they havent noticed that yet).  However, I can confirm it worked fine in 4.1.2 as I tested this, but not in 4.2.0 or 4.2.1

Unfortunately for me, I work for a company who feel the need to love microsoft.. (personally, Id have it all running on a unix box, all files, Email, web.. the works.. but, sadly, if microsoft make it, they love it. So, I just dont get the choice.
 [2002-06-03 05:08 UTC] mfischer@php.net
Of course it does. Internally, the $toaddr part is taken and put into RCPT TO: <$toaddr> which will expand to
RCPT TP: <$name - $action <$toaddr>> in your case which is invalid (though I know qmail still handles it properly, exim may feel, don't remember sendmail).

in 4.1.2, If the $header contained a TO, it used in the mail header. This was changed in 4.2.x and I re-introduced it in HEAD (snaps.php.net/win32, not the stable version).

However, as Manuel pointed out on php-qa@, you're probably better off using some external code to handle your mail generation of you rely heavily on it.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Dec 05 12:01:29 2024 UTC