|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #15221 Mail function does not work
Submitted: 2002-01-25 07:20 UTC Modified: 2002-03-19 00:00 UTC
Avg. Score:4.4 ± 0.8
Reproduced:4 of 4 (100.0%)
Same Version:1 (25.0%)
Same OS:2 (50.0%)
From: dansixus at yahoo dot com Assigned:
Status: No Feedback Package: Mail related
PHP Version: 4.1.1 OS: Windows XP Pro.
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
Solve the problem:
11 + 31 = ?
Subscribe to this entry?

 [2002-01-25 07:20 UTC] dansixus at yahoo dot com
The mail() function does not seem to work. I am getting this error: 
Warning: Unknown error in c:\apache\htdocs\auctions\mailtest.php on line 2

Mailtest.php contains the following:

mail("", "PHP Mail test", "Line 1\nLine 2\nLine 3");

My PHP.ini mail function settings seem to be ok too:
sendmail_from =

I am using PHP 4.1.1 under apache. Other PHP scripts work fine but this mail function does not work. 

Please help me fix this problem  


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2002-01-25 11:50 UTC]
Check your SMTP settings. Probably the mailserver refuses your message. Check if authentication is needed and more like that. 
 [2002-02-27 04:44 UTC] milamamu at tiscalinet dot it
Try change \n with \r\n
 [2002-03-19 00: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".
 [2003-04-03 15:05 UTC] ianring at golden dot net
Running the code below, $success is false. I do not know why the mail() function is not working. No other error messages appear on the screen.

	$to = "";
	$subject = "this is a test";
	$body = "hi, \n I'm so glad you received this";

	$success = mail($to,$subject,$body);


	print("mail was sent");
	print("mail was NOT sent");
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jun 17 05:01:31 2024 UTC