php mail

Ye' old general discussion board. Basically, for everything that isn't covered elsewhere. Come here to shoot the breeze, shoot your mouth off, or whatever suits your fancy.
This forum is not for asking programming related questions.

Moderator: General Moderators

Post Reply
bangla123
Forum Newbie
Posts: 9
Joined: Wed Jan 26, 2011 10:36 pm

php mail

Post by bangla123 »

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.
devarishi
Forum Contributor
Posts: 101
Joined: Fri Feb 05, 2010 7:15 pm

Re: php mail

Post by devarishi »

Check for SMTP's value in the php.ini file on your Windows Box. The Port Number should be 25 and SMTP's value should be set to an SMTP Server's name or IP address (preferred).

Check whether it works or not.
Post Reply