alexjewell
06-03-2007, 11:39 PM
I've never had trouble with mailing before, and I'm quite shocked that this wont work. I can't see anything wrong with the script, and no errors are being thrown back. The email just doesn't show up. Let me know if you see something wrong with the code:
<?php
$to = 'alexjewell@sbcglobal.net';
$fname = $_REQUEST['firstname'] or 'No First Name!';
$lname = $_REQUEST['lastname'] or 'No Last Name!';
$name = $fname.' '.$lname;
$address = $_REQUEST['address'] or 'No Address Submitted!';
$city = $_REQUEST['city'] or 'No City Submitted!';
$state = $_REQUEST['state'];
if(@$_REQUEST['zip']){
$zip = $_REQUEST['zip'];
if(ctype_digit($zip)){
$zip = $_REQUEST['zip'];}
else{$zip = 'Zip Submitted Not Valid!';}}
else{
$zip = 'No Zip Submitted!';}
if(@$_REQUEST['email']){
$email = $_REQUEST['email'];
if(!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)){
$email = $_REQUEST['email'];}
else{$email = 'Email Address Submitted Not Valid!';}}
else{
$email = 'No Email Address Submitted!';}
$comments = stripcslashes($_REQUEST['comments']) or 'No Comments Submitted';
$updates = $_REQUEST['updates'] or 'No, Thank You';
$subject = 'Partner Submission.';
$body = '
Name: '.$name.'
Address: '.$address.'
City: '.$city.'
State: '.$state.'
Zip: '.$zip.'
Email: '.$email.'
Comments: '.$comments.'
Updates: '.$updates;
if(mail($to,$subject,$body,$email)){ ?>
<h1>Thank You For Partnering!</h1>
<p>Your generous partnership is a blessing and God will bless you for it. Whether it's a commitment to pray or
give money, your gift is greatly appreciated.</p><br /><br />
<?php }
else{ ?>
<h1>There has been an error</h1>
<p>For some reason, your submission did not go through. You can try again by visiting the partnership page. If
it doesn't work again, please let me know by going to the contact page and sending me an email.</p><br /><br />
<?php } ?>
<?php
$to = 'alexjewell@sbcglobal.net';
$fname = $_REQUEST['firstname'] or 'No First Name!';
$lname = $_REQUEST['lastname'] or 'No Last Name!';
$name = $fname.' '.$lname;
$address = $_REQUEST['address'] or 'No Address Submitted!';
$city = $_REQUEST['city'] or 'No City Submitted!';
$state = $_REQUEST['state'];
if(@$_REQUEST['zip']){
$zip = $_REQUEST['zip'];
if(ctype_digit($zip)){
$zip = $_REQUEST['zip'];}
else{$zip = 'Zip Submitted Not Valid!';}}
else{
$zip = 'No Zip Submitted!';}
if(@$_REQUEST['email']){
$email = $_REQUEST['email'];
if(!preg_match("/^( [a-zA-Z0-9] )+( [a-zA-Z0-9\._-] )*@( [a-zA-Z0-9_-] )+( [a-zA-Z0-9\._-] +)+$/" , $email)){
$email = $_REQUEST['email'];}
else{$email = 'Email Address Submitted Not Valid!';}}
else{
$email = 'No Email Address Submitted!';}
$comments = stripcslashes($_REQUEST['comments']) or 'No Comments Submitted';
$updates = $_REQUEST['updates'] or 'No, Thank You';
$subject = 'Partner Submission.';
$body = '
Name: '.$name.'
Address: '.$address.'
City: '.$city.'
State: '.$state.'
Zip: '.$zip.'
Email: '.$email.'
Comments: '.$comments.'
Updates: '.$updates;
if(mail($to,$subject,$body,$email)){ ?>
<h1>Thank You For Partnering!</h1>
<p>Your generous partnership is a blessing and God will bless you for it. Whether it's a commitment to pray or
give money, your gift is greatly appreciated.</p><br /><br />
<?php }
else{ ?>
<h1>There has been an error</h1>
<p>For some reason, your submission did not go through. You can try again by visiting the partnership page. If
it doesn't work again, please let me know by going to the contact page and sending me an email.</p><br /><br />
<?php } ?>