|   | php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login | 
| 
  [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:
<?php
mail("dansixus@yahoo.com", "PHP Mail test", "Line 1\nLine 2\nLine 3");
?>
My PHP.ini mail function settings seem to be ok too:
SMTP: mail.keyworld.net
sendmail_from = dansixus@yahoo.com
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  
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits             | |||||||||||||||||||||||||||||||||||||
|  Copyright © 2001-2025 The PHP Group All rights reserved. | Last updated: Fri Oct 31 04:00:01 2025 UTC | 
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. <?php $to = "heyianring@hotmail.com"; $subject = "this is a test"; $body = "hi, \n I'm so glad you received this"; $success = mail($to,$subject,$body); ?> <P> <?php if($success){ print("mail was sent"); }else{ print("mail was NOT sent"); } ?>