I am using xampp 1.7.4 (PHP 5.3.5) and when i send emails to my email address its working. and even i used mail server as examples its not working. below is the code.
<?php
ini_set("SMTP","mail.sweetinteractive.com");
$suc = mail("uzair@sweetinteractive.com","Learning PHP","Message is not working ","From: uzair@sweetinteractive.com");
if($suc){
echo "Mail sent";
} else {
echo "Mail sending Failed.";
}
?>
And even i tried out working with our mail server. But its showing and error
Warning: mail() [function.mail]: SMTP server response: 550 Access denied - Invalid HELO name (See RFC2821 4.1.1.1) in C:\xampp\htdocs\LearnPhp\email1.php on line 3
Please configure your php.ini and sendmail.ini files in xampp folder.
First : need to change the fields in php.ini (rootdrive:\xampp\php\php.ini)
(Note : semicolon ‘;’ signifies a comments in ini files)
second step : change the sendmail.ini file (rootdirectory:\xampp\sendmail\sendmail.ini)
note : remove semicolon (;) form give below fields
and make changes in sendmail.ini file
I believe this should gonna work. Because you are not providing any authentication parameters in previous post.
Note : after making the changes in php.ini and sendmail.ini files, stop the apache service from Xampp control panel and run it again.
and your php code