I have a default installation of WAMP Server 2.0.
I'm trying to send email using this simple script:
<?php
if (mail('[email protected]', 'My Title', 'Some Text')) {
echo "OK";
} else {
echo "Why ??";
}
?>
Unfortunately, I get the following warning:
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:\My_Path\send_email.php on line 3 Why ??
What could be the reason for that ?
I expected sending email to be a very simple task ... :(
mail()function connects to the server configured in your php.ini file (as outlined in the error message) and instructs it to send a message. I would suggest googling sending email with php and gmail for a good tutorial about the basics ofmail()and smtp servers. - Mike B