Ok, i have the following script to send mail thro SMTP on a XP pro machine.
[code=php]<?PHP
function valid_email($email) {
$regexp = “^([_a-z0-9-]+)(.[_a-z0-9-]+)*@([a-z0-9-]+)(.[a-z0-9-]+)*(.[a-z]{2,4})$”; //Validate the email address
$valid = 1; //Presume it is valid
if(eregi($regexp, $email)) {
return $valid;
}
}
if(isset($_GET[“task”]) && $_GET[“task”] != “”) {
if(isset($_POST[“email”]) && $_POST[“email”] != “”) {
if(isset($_POST[“subject”]) && $_POST[“subject”] != “”) {
if(isset($_POST[“message”]) && $_POST[“message”] != “”) {
if(isset($_POST[“cc”]) && $_POST[“cc”] != “”) {
if(valid_email($_POST[“email”])) {
if(valid_email($_POST[“cc”])) {
$headers = “From: “. $_POST[“email”] .”rn”;
$headers .= “Cc: “. $_POST[“cc”] .”rn”;
mail(“[email protected]”, $_POST[“subject”], $_POST[“message”], $headers);
echo “Your mail has been sent. We will get back to you shortly.”;
}else{
echo “The Cc email address’s you entered are not valid. Please go back and enter valid one(s).”;
}
}else{
echo “The email address you entered is not valid. Please go back and enter a valid one.”;
}
}else{
if(valid_email($_POST[“email”])) {
$headers = “From: “. $_POST[“email”] .”rn”;
mail(“[email protected]”, $_POST[“subject”], $_POST[“message”], $headers);
echo “Your mail has been sent. We will get back to you shortly.”;
}else{
echo “The email address you entered is not valid. Please go back and enter a valid one.”;
}
}
}else{
echo “You need to go back and enter a message.”;
}
}else{
echo “You need to go back and enter a subject.”;
}
}else{
echo “You need to go back and enter an email address.”;
}
}
?>
Now this script works with PHP installed and running on IIS 5(on XP Pro SP1). I tried putting it on a server 2k3(IIS 6) and when i submit the form(and it to send the mail) it doesnt bring up any errors and says everything was sent fine. however when i check my mail nothing is getting recieved….anyone have an idea on what’s wrong?
FYI:we tried another PHP send mail script another person made to make sure mine wasn’t screwy and it did the same thing. it says it send it but in reality it doesnt.
any help or ideas is appriciated.