0
<?php


//email(to,subject,message,headers,parameters)

$to="swissknife@gmail.com>";
$subject="Hi";
$message="Hello my friend";
$from="swissknife007@gmail.com";
$headers="from:".$from;
mail($to,$subject,$message,$headers);
echo" mail sent";

?>

This is a very simple php script to send an email.
However ,it is not working for me and I am getting the 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 F:\xampp\htdocs\email1.php on line 10

mail sent

I am using XAMPP for php.
What values should I set the in php.ini ?
Please explain in detail

3
Contributors
2
Replies
3
Views
5 Years
Discussion Span
Last Post by pro_learner
0

You cannot send email with XAMPP using mail(), unless you have a mail server installed. Please search this forum for solutions using PHPMailer.

0

Yes first you have to install a SMTP server.There are several free SMTP servers.Do a google search on SMTP servers and you can find further details about this by searching Daniweb previous threads about this.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.