-
-
Notifications
You must be signed in to change notification settings - Fork 64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Subject header is duplicated #72
Comments
I was not able to reproduce this error. It seems, it is fixed in the current version. Successfully tested on Windows 10 Pro with php-7.1.26-Win32-VC14-x64, php-7.2.15-Win32-VC15-x64 and php-7.3.2-Win32-VC15-x64. Used quickstart example for Sendmail Transport Usage use Zend\Mail\Message;
use Zend\Mail\Transport\Sendmail as SendmailTransport;
$message = new Message();
$message->addTo('[email protected]');
$message->addFrom('[email protected]');
$message->setSubject('Greetings and Salutations!');
$message->setBody("Sorry, I'm going to be late today!");
$transport = new SendmailTransport();
$transport->send($message); Received mail
Edit: zend-mail v2.10.0 Originally posted by @arueckauer at zendframework/zend-mail#22 (comment) |
But why is And for clarity include the value of your current zend-mail version. Originally posted by @glensc at zendframework/zend-mail#22 (comment) |
Very good observation, I will have a look into it. This might be a new issue. Originally posted by @arueckauer at zendframework/zend-mail#22 (comment) |
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
Signed-off-by: Abdul Malik Ikhsan <[email protected]>
Summary
On Windows with PHP 7, when sending an mail message with the Sendmail transport, the subject header is duplicated.
Steps to reproduce
To reproduce the bug the sample from here can be used:
http://framework.zend.com/manual/current/en/modules/zend.mail.introduction.html
The resulting mail headers look something like this:
Subject: Test Subject
Date: Wed, 29 Jul 2015 17:33:17 +0000
From: =?UTF-8?Q?test?= [email protected]
To: [email protected]
Subject: Test Subject
Cause
In the Sendmail transport all headers (including the Subject) and the subject itself are passed to the php mail function:
$result = mail($to, $subject, $message, $headers);
The mail function then appends to the $subject to the $headers. I do not think the php mail function should handle this case because it doesn't know what subject the caller intended to use. However I believe php mail should at least issue a warning (TBD: file enhancement at https://bugs.php.net/).
Solution
Pass the headers without the Subject header to the php mail function. This is already done if the os is not Windows in the prepareHeaders. I think it should be done for Windows as well.
Originally posted by @matbech at zendframework/zend-mail#22
The text was updated successfully, but these errors were encountered: