I have xampp/eclipse/windowsxp. below code does not send any email. I dont know whether i need to do something with php.ini file. or i need mail server. I am new to this.

When i run the following code in eclipse, i get message saying Mail Sent but i never get any message in hotmail(not even in gmail ). I am not sure why?
$to = "safiullah12@hotmail.com";
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "safiullah12@hotmail.com";
$headers = "From: $from";
echo "Mail Sent.";

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:

does not work.
if i run this php file, i get msg saying msg sent but i never got the email.

I am not sure how i can set up the sendmail.ini and php.ini file.

Pls help. thanks.

7 Years
Discussion Span
Last Post by bangla

I am not sure but if it works under the Xampp folder and not the aaa folder than the issue is not with your code you have posted but with the configuration of Xampp. It isn't going to be your php.ini file since it only contains the host and port to use so if it were wrong it would not work in any directory.

You most likely have a permissions issue or configuration issue with the SMTP service running on the system. I would recommend trying the Xampp forums for assistance.

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.