Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP form mailer not working?

    I am fairly new to PHP and i found an open source form mailer script so that you could send form feedback to your email but it doesnt seem to be working i set the mailer.php file to send to sharkey182uk at hotmail dot com (spam reasons i wrote it like this here) after i have submitted it brings up my thankyou.php file but it doesnt seem to be working correctly. I have tested it a few times but still no luck could anyone please help me out.


    Any help is greatly appreciated.

  • #2
    Regular Coder
    Join Date
    Mar 2004
    Posts
    115
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i suggest you try with a non hotmail account

    hotmail can be funny they block spammers(not saying your a spammer)

    but your host may have been blacklisted this is proberbly not there fault

    they may have had a customer who abused there servers(they can be removed from list but it takes time

    you could also try changing the headers you are sending

    ps/ it would be better to post some code as this might help to identify the cause

  • #3
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is my form mailer code here. Yeah i agree it coudl be my host.

    PHP Code:
    <?PHP 

    ####################################################### 
    # This script is Copyright 2003, Infinity Web Design  # 
    # Distributed by [url]http://www.webdevfaqs.com[/url]            #
    # Written by Ryan Brill - [email]ryan@infinitypages.com[/email]      # 
    # All Rights Reserved - Do not remove this notice     # 
    ####################################################### 

    ## The lines below need to be edited... 

    ###################### Set up the following variables ###################### 

    $to "sharkey182uk@hotmail.com"#set address to send form to 
    $subject "Feedback Form"#set the subject line 
    $headers "From: Form Mailer"#set the from address, or any other headers 
    $forward 1# redirect? 1 : yes || 0 : no 
    $location "thankyou.php"#set page to redirect to, if 1 is above 

    ##################### No need to edit below this line ###################
    ### 

    ## set up the time ## 

    $date date ("l, F jS, Y"); 
    $time date ("h:i A"); 

    ## mail the message ## 

    $msg "Below is the result of your feedback form. It was submitted on $date at $time.\n\n"

    if (
    $_SERVER['REQUEST_METHOD'] == "POST") {
        foreach (
    $_POST as $key => $value) { 
            
    $msg .= ucfirst ($key) ." : "$value "\n"
        }
    }
    else {
        foreach (
    $_GET as $key => $value) { 
            
    $msg .= ucfirst ($key) ." : "$value "\n"
        }
    }

    mail($to$subject$msg$headers); 
    if (
    $forward == 1) { 
        
    header ("Location:$location"); 

    else { 
        echo 
    "Thank you for submitting our form. We will get back to you as soon as possible."


    ?>

  • #4
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey guys ive received the emails now but there is still one problem the fact that i added more <input>s etc to the forum only the ones in the template emailed to me. Could it be that they all have the same name="message" as i have changed that now.

    Hope yous can help

  • #5
    New Coder
    Join Date
    Apr 2004
    Location
    Texas
    Posts
    60
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I would recommend this formmail script....it's easy to setup, and it has worked well for me, no matter how many fields you have. It's a php clone of the famous matt's script archive formmail script. It's a lot longer than the once you have.....so thinking it's a lot more intelligent, it will allow form validation, etc......built in.

    http://www.boaddrink.com/projects/phpformmail/
    Jason B

  • #6
    New Coder
    Join Date
    Dec 2003
    Location
    UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hey thanks mate i will give that a try.


    Thanks for all help again


  •  

    Posting Permissions

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