PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
$to = "spam@yahoo.ca";
$subject = "Spamming Is Great";
$body = "Spam is one of the best scripting languages around";
$headers = "From: Arrest@FBI.com\n";
mail($to,$subject,$body,$headers);
echo "Mail sent to $to";
?>
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\Program Files\DzSoft\PHP Editor\phpB4.tmp on line 16
Mail sent to spam@yahoo.ca
I checked my mail after 10 min and there were no new mail.
Could you plz write a working script for sending mail?
Last edited by tsalexey544 on Fri Jun 23, 2006 5:06 am, edited 1 time in total.
Otherwise if you are on XP, check if you have the SMTP service installed ... Control Panel --> Adminstrative Tools --> Services --> Look for Simple Mail Transfer Protocol (SMTP) and start it up.