sankar62 0 Newbie Poster

i got error while run the below script...............................
what should i do to send mail using php script??

script:

<?php
$to="someone@gmail.com";
$subject="php mail";
$body="mail sending using php script";
$header="From:me@gmail.com";
if(mail($to,$subject,$body,$header))
{
echo "mail was sent to $to with subject $subject";
}
else
{
print("<script language='javascript'>alert('error');</script>");
}
?>
---------------------------------------------------------------------------------------------------------
i got error like the below one:

Warning: mail() [function.mail]: Failed to connect to mailserver at "smtp.my.isp.net" port 587, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\test\mail.php on line 6
--------------------------------------------------------------------------
my php.ini setting is like below:

[mail function]
; For Win32 only.
SMTP =smtp.my.isp.net
smtp_port = 587
; For Win32 only.
sendmail_from =me@myserver.com
----------------------------------------------------
i'm using xampp and windows internet explorer........
please anyone help me...... what should i do??..........

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.