php mail
Posted: Sun Feb 06, 2011 8:53 am
Hi,
I have xampp/eclipse/windowsxp.
installed directory as follows:
php.ini > c/program files/xampp/php/php.ini
sendmail > c/program files/xampp/sendmail/sendmail.ini
xampp > c/program files/xampp
eclipse > c/program files/eclipse
what works:
http://localhost/xampp/
does not work.
http://localhost/aaa/sendMail.php
<?php
$to = "safiullah12@hotmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "safiullah12@hotmail.com";
$headers = "From: $from";
if(mail($to,$subject,$message,$headers)) {
echo 'mail was sent';
} else {
echo 'an error occured: mail was not sent';
}
?>
I am not sure how i can set up the sendmail.ini and php.ini file.
if i run this php file in eclipse, i get msg saying "msg sent" but i never got the email. I dont know whether i need to do something with php.ini file. or i need mail server. I am new to this.
Pls help.
I have xampp/eclipse/windowsxp.
installed directory as follows:
php.ini > c/program files/xampp/php/php.ini
sendmail > c/program files/xampp/sendmail/sendmail.ini
xampp > c/program files/xampp
eclipse > c/program files/eclipse
what works:
http://localhost/xampp/
does not work.
http://localhost/aaa/sendMail.php
<?php
$to = "safiullah12@hotmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "safiullah12@hotmail.com";
$headers = "From: $from";
if(mail($to,$subject,$message,$headers)) {
echo 'mail was sent';
} else {
echo 'an error occured: mail was not sent';
}
?>
I am not sure how i can set up the sendmail.ini and php.ini file.
if i run this php file in eclipse, i get msg saying "msg sent" but i never got the email. I dont know whether i need to do something with php.ini file. or i need mail server. I am new to this.
Pls help.