PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?
$to = "my-mail@btopenworld.com";
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: ".$_POST['frmail']."\r\n";
$mail = @mail($to,$_POST['subj'],$_POST['msg'],$headers);
// The "@" sign before the mail() call suppresses printing of errors
// that may occur. The test below will check for errors instead:
if(!$mail){
echo "Email not sent! Please try later...";
}else{
echo "Mail sent successfully!";
}
?>
The problem is when i click the send button it says "e-mail not sent! blah blah blah," can anyone tell me why this is happening according to my server it is all set up. http://www.foci.co.uk/phpcheck.php
Hmmmm im not sure but have you tried it without the "headers"? i think you may have a problem with the headers...i dont tink its done correctly....i have posted some mail scripts search for my name under "mail()" and see what you come up with maybe it may prove some help
more than likely, i havent bothered with send-mail so i couldnt tell you, however i believe you have to be able to have direct access to your PHP.ini to use it
The sendmail_path only applies to *nix machines. The phpinfo() in this case indicates it is running on a windows box therefore the sendmail_path should not have a value.
The sendmail_from value is the default value to use if from is not specified within your mail function call.
Assuming the SMTP address is valid it looks like mail is setup correctly.