Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

PHP contact form

  • 28-02-2007 12:07am
    #1
    Closed Accounts Posts: 44


    Hi all

    Having a bit of bother with my sites contact form, it works fine but if i send it to my hotmail or gmail account they get really suspicious of it and send it to Junk, sometimes even giving me warnings that they suspect its Phishing

    Is there anything i can do to make the form more legit so my Hotmail account wont treat it like crap

    Here is the php im using

    <?
    $email = $_REQUEST ;
    $message = $_REQUEST ;
    $name = $_REQUEST ;
    $reason =$_REQUEST ;

    if (!isset($_REQUEST)) {
    header( "Location: contact.html" );
    }
    elseif (empty($email) || empty($message)) {
    ?>


    <h1>Error</h1>
    <p>
    Oops, it appears you forgot to enter either your
    email address or your message. Please press the BACK
    button in your browser and try again.
    </p>


    <?
    }
    else {
    mail( "email i want results sent to", "Feedback Form","$reason\n\n$message", "From: $name" );
    header( "Location: thankyou.html" );
    }
    ?>

    Thanks Daryll


Comments

  • Registered Users, Registered Users 2 Posts: 4,792 ✭✭✭cython


    It might help to have an actual email as the from, as you currently only seem to include a name in the message.

    Basically, I'd suggest using as many of the headers as you can (within reason) for the mail function, so that your mail provider sees it as being as genuine as possible.

    Also, perhaps allowing for the user to set the subject, as opposed to "Feedback Form". Perhaps thats a trigger in the filter.

    I'm just going off what I did differently for a form myself, and Gmail never marks the stuff as spam


  • Registered Users, Registered Users 2 Posts: 1,987 ✭✭✭Ziycon


    Below is how it should be and you should have the highlighted header redirect as the first line of the page, nothing before it!
    <?
    $email = $_REQUEST['email'] ;
    $message = $_REQUEST['message'] ;
    $name = $_REQUEST['name'] ;
    $reason =$_REQUEST['reason'] ;
    
    if (!isset($_REQUEST['email'])) {
    header( "Location: contact.html" );
    }
    elseif (empty($email) || empty($message)) {
    ?>
    
    
    <h1>Error</h1>
    <p>
    Oops, it appears you forgot to enter either your
    email address or your message. Please press the BACK
    button in your browser and try again.
    </p>
    
    
    <?
    }
    else {
    mail( "email i want results sent to", "Feedback Form","$reason\n\n$message", "From: $email" );
    [B][COLOR="Red"]header( "Location: thankyou.html" );[/COLOR][/B]
    }
    ?>
    


  • Closed Accounts Posts: 7,563 ✭✭✭leeroybrown


    Have a look at the headers in the e-mail's that arrive to you. If they have passed through a Spam filter them may have the 'X-Spam-Report: ' header which might give you some useful information.

    The one obvious problem that comes to mind is that the 'Return-path: ' for the e-mail may be set as the user the web server runs as and as such won't match the 'From: ' field. This will flag it as having a forged sender.


  • Closed Accounts Posts: 44 daryllsheridan


    Cheers people I got it sorted

    It was because i was including the persons name in the email address section

    Spam filter obviously thought that meant i was pretending to be some1 i wasnt

    Moved the name down into the message part and it worked fine


Advertisement