|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14954 Warning: Server Error with mail() function
Submitted: 2002-01-09 17:10 UTC Modified: 2002-07-03 01:00 UTC
Avg. Score:4.4 ± 1.0
Reproduced:37 of 37 (100.0%)
Same Version:18 (48.6%)
Same OS:25 (67.6%)
From: jberall at yahoo dot com Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.1.0 OS: Windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: jberall at yahoo dot com
New email:
PHP Version: OS:


 [2002-01-09 17:10 UTC] jberall at yahoo dot com
The mail() function doesn't work properly.  
Every so often it does send mail.
I tried putting the php.ini in the c:\php\php.ini instead of the c:\winnt\php.ini but that didn't help.
I've been at it a while and I've found no solutions on the web yet, while other people have encountered the same issue.
PHP.INI has a valid SMTP = and sendmail_from =

The code
mail("", "My Subject", "Line 1\nLine 2\nLine 3");
And the birthday one from the manual.
Again the frustrating part is it worked last night. My outlook works perfectly with the same SMTP.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-02 13:51 UTC]
Error handlig has been improvied, please try a snapshot from
 [2002-07-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 [2004-07-01 22:57 UTC] cleilton at secrel dot net dot br
I have the same problem using php 4.2, windows 2000 server iis5.
I resolve the problem using \r\n not \n for the break line.

mail("", "My Subject", "Line 1\nLine 2\nLine 3");

This code results in a server error

Correct code:

$email = mail("", "My Subject", "Line 1\r\nLine 2\r\nLine 3");

If ($email){
    echo "E-mail was sent!";

PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 12 11:01:32 2024 UTC