Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: Mail Form

  1. #1
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default Mail Form

    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 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 ?>
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  2. #2
    Join Date
    Mar 2006
    Location
    Illinois, USA
    Posts
    12,164
    Thanks
    265
    Thanked 690 Times in 678 Posts

    Default

    Have you had success with other email scripts on this server?
    Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum

  3. #3
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Yeah, I have. In fact, there's another mail form that's working at the same time on the server. Ha, makes no sense.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Your generous partnership is a blessing and God will bless you for it.
    Presuming to know the minds of deities?

    Are you certain you don't have any spam filters that could be deleting it?
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Haha, it's for a client who's a missionary.

    And yes, I'm sure. I keep thinking maybe the emails are just getting delayed and will probably all show up tomorrow or something. Ha.

    So basically, there's nothing wrong with the code itself that could be causing this?
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  6. #6
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    From what I can tell, the code looks fine.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

  7. #7
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Looks OK to me too.

    There are lots of passages in the Bible saying how God and his thoughts are far beyond human comprehension
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  8. #8
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    Alright, well, I'll contact my host and ask them if they've recently changed something. I just tried my other mail form, and it isn't working either.
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  9. #9
    Join Date
    Mar 2006
    Location
    Cleveland, Ohio
    Posts
    574
    Thanks
    6
    Thanked 5 Times in 5 Posts

    Default

    I talked to some foreign customer service people, who didn't really seem to know what they were talking about. Anyway, what they said was I couldn't use PHP to send mail on windows servers and had to use ASP. What I don't understand is that PHP works for everything else on this server, so why would the mail function be the only thing not working because of the server being windows?

    Also, the mail function worked up until recently anyway, but they claim they haven't made any changes. Well, neither have I.

    Any ideas?
    Thou com'st in such a questionable shape
    Hamlet, Act 1, Scene 4

  10. #10
    Join Date
    Sep 2006
    Location
    St. George, UT
    Posts
    2,769
    Thanks
    3
    Thanked 157 Times in 155 Posts

    Default

    Simple answer, they (your host) don't know what they are talking about.
    "Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian Wilson, Nintendo, Inc, 1989
    TheUnlimitedHost | The Testing Site | Southern Utah Web Hosting and Design

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •