ID:               41732
 User updated by:  as at as dot hu
 Reported By:      as at as dot hu
 Status:           Open
 Bug Type:         Mail related
 Operating System: Windows 2003
 PHP Version:      4.4.7
 New Comment:

It's a real bug. :-)
because when I use the mail function, the mail bounced from some
server. It is bug.

Please try sending mail to this address:
ashutest(at)vipmail.hu

This server is not Windows server, and MUST sending mail to this server
with CrLf.

Please read http://www.faqs.org/rfcs/rfc822.html


But, oK.
How to set up correctly php on windows?
In my php.ini I cannot see settings for CRLF:

[mail function]
; For Win32 only.
SMTP = mail.xxx.hu
smtp_port = 25

; For Win32 only.
sendmail_from = return(at)xxx.hu

; For Unix only.  You may supply arguments as well (default: "sendmail
-t -i").
;sendmail_path =



When I use Wordpress, the mails not sendig for some host. Same in
phpNuke, etc... So I think, it's a bug in php mail sending function.


Previous Comments:
------------------------------------------------------------------------

[2007-06-20 12:30:35] bas at tobin dot nl

Hi,

This is not a bug of PHP. 

E-Mail being transferred between mail servers needs CrLf (\r\n) as EOL
separator. The catch however is how PHP sends the mail to your outbound
mail server. On windows you always need to separate mail headers and end
of lines with CrLf as this is the standard windows EOL separator. On
Linux this depends on the mail injector of your Mail Server. For
instance qmail expects the EOL separator to be the same as the standard
linux separator Lf(\n) and when sending the message outbound converts
all these Lf's to CrLf. If you feed this script with CrLf you will send
E-Mail messages having extra white lines.

If your PHP script does not send the message to a typical local mail
injector but to a normal inbound mail port it will have to follow RFC's
and CrLf will be needed again.

So depending on your setup you either need to send CrLf or Lf between
lines.

------------------------------------------------------------------------

[2007-06-18 20:32:03] as at as dot hu

Description:
------------
On Windows 2003, default smtp server.
When I use the mail function, some target e-mail system say:
195.56.151.XX, OutboundConnectionResponse, 2007. 06. 18., 22:06:43,
SMTPSVC1, AS, -, 312, 0, 47, 0, 0, -, -, 451 See
http://pobox.com/~djb/docs/smtplf.html.,



Reproduce code:
---------------
$subject = "Elveszett jelszó";
$headers = "From: ".$mail_pswd_from."\nX-FW-MailID:s6s06s9s80";
$row=mysql_fetch_array($result);
$to = $row['usr_email'];
$body = "Tisztelt ".$row[usr_lastname]." ".$row[usr_firstname]."!\nAz
Ön jelszava: ".$row[usr_pswd]."\n\nÜdvözlettel,\nA S";
mail($to,$subject,$body,$headers);

Expected result:
----------------
The email bounce to the sender from some hosts. (like citromail.hu,
vipmail.hu) with this error message:
http://pobox.com/~djb/docs/smtplf.html

Actual result:
--------------
When I replace all newline to CRLF, the mail went away without
problem:


$subject = "Elveszett jelszó";
$headers = "From: ".$mail_pswd_from."\nX-FW-MailID:s6s06s9s80";
$row=mysql_fetch_array($result);
$to = $row['usr_email'];
$body = "Tisztelt ".$row[usr_lastname]." ".$row[usr_firstname]."!\nAz
Ön jelszava: ".$row[usr_pswd]."\n\nÜdvözlettel,\nA S";
$body = str_replace("\r\n","\n",$body);
$body = str_replace("\r","\n",$body);
$body = str_replace("\n","\r\n",$body);
mail($to,$subject,$body,$headers);


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41732&edit=1

Reply via email to