php.net |  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
Votes:45
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
 [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 =  mail.pnang.com and sendmail_from = jberall@yahoo.com.

The code
mail("jberall@yahoo.com", "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.
Thanks,
Jonathan

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-06-02 13:51 UTC] mfischer@php.net
Error handlig has been improvied, please try a snapshot from http://snaps.php.net/win32/php4-win32-latest.zip
 [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.
Example:

mail("cleilton_ce@hotmail.com", "My Subject", "Line 1\nLine 2\nLine 3");

This code results in a server error

Correct code:

$email = mail("cleilton_ce@hotmail.com", "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: Sat Oct 05 03:01:28 2024 UTC