PHP: Mail error issuem testing via XAMPP?

  • Thread starter Thread starter raisin_smiles
  • Start date Start date
R

raisin_smiles

Guest
I have received the following error on my home pc:-

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in E:\xampp\htdocs\MYPHP\mailer.php on line 3

I've double checked my code and stripped it back to hardcoded values ensuring I specified the required values (see below).

<?php
if(isset($_POST['submit'])) {
mail("[email protected]","Subject Hello","A message");
} else {
echo "Someone didn't press submit!";
}
?>

Any idea why I get this message and how to resolve it?

Thanks
Added those details which I assume are my email client details.

Now asks for more email details:-
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\xampp\htdocs\MYPHP\mailer.php on line 4

I was planning to host this site on a free web server and its the first time I've used php to use the mail function so unsure what settings should be used.

Thanks for the reply!
Could It be that I dont actually have a mailserver?? As XAMPP doesnt include it within the package?

Could anyone recommend one for use with XAMPP?
Im running Windows XP and connecting tot he internet via a wireless routher.

Can anyone recommend a SMTP software to install to allow me to setup a SMTP server on my pc?
 
Back
Top