Saturday, 17 August 2013

send mail from php

send mail from php

I am new at php. I was trying to send mail from php using this code.
<?php
$to = 'sohildesai.2711@gmail.com';
$subject = 'The subject';
$message = 'hello';
$headers = 'From: sohildesai.2711@yahoo.in' . "\r\n" .
'Reply-To: dhamaal_2222@yahoo.in' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers);
?>
so it is giving me this error.
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:\xampp\htdocs\sandeep\index.php on line 10
Can anybody help me to solve this error. In php.ini which setting should I
have to configure?

No comments:

Post a Comment