Hey Guys,
I’m trying to trouble shoot this problem I am having. I am getting Undelivered Mail Returned to Sender from only AOL users but the emails are coming through to me. But I do also notice that the emails are being sent from the user entering the giveaway not mine.
P.S. I have removed the business name from the code.
Thanks guys!
HTML:
[php]
Full Name:
Email Address: |
Confrim Email: |
I agree to the Terms & Conditions |
[/php]
PHP:
[php]<?php
// first clean up the input values
foreach($_POST as $key => $value) {
if(ini_get(‘magic_quotes_gpc’))
$_POST[$key] = stripslashes($_POST[$key]);
$_POST[$key] = htmlspecialchars(strip_tags($_POST[$key]));
}
$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = “[email protected]”;
$email_subject = “50 Daily Entry”;
$email_message .= “Name Entered: “.$_POST[“name”].”\n”;
$email_message .= “Email Address: “.$_POST[“email”].”\n”;
$email_message .= “Confirm Email: “.$_POST[“cemail”].”\n”;
$email_message .= “I agree: “.$_POST[“agree”].”\n”;
$userEmail = filter_var( $_POST[‘email’],FILTER_VALIDATE_EMAIL );
if( ! $userEmail ){
exit;
}
//email headers
$headers = 'From: '.$_POST[“email”]."\r\n".
'Reply-To: '.$_POST[“email”]."\r\n" .
‘X-Mailer: PHP/’ . phpversion();
echo (mail($email_to, $email_subject, $email_message, $headers) ? "
":“
We’re sorry, something went wrong.
”);$ip=$_SERVER[‘REMOTE_ADDR’];
$email_to = $_POST[“email”];
$email_subject = “Daily Cash Giveaway |”;
$email_message1 = "Welcome to!
Thank you for entering to win 50 dollars from the cash giveaway. Please check this email address later to see if your the lucky winner!
Sincerely,
";
//email headers
$headers = 'From: '.$_POST[“email”]."\r\n".
'Reply-To: '.$_POST[“email”]."\r\n" .
‘X-Mailer: PHP/’ . phpversion();
echo (mail($email_to, $email_subject, $email_message1, $headers) ? “”:"");
// Required field names
$required = array(‘name’, ‘email’);
// Loop over field names, make sure each one exists and is not empty
$error = false;
foreach($required as $field) {
if (empty($_POST[$field])) {
$error = true;
}
}
if ($error) {
echo “All fields are required.”;
} else {
echo “Proceed…”;
}
?>[/php]