Form Autoresponder.

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Andy

    #1

    Form Autoresponder.

    I need your help to check if my autoresponder will work in the following
    script. I am testing my PHP scripts on free server, which dosen't allow me
    to send email letters from my website.
    Please tell me if every thing is ok, if not please correct my mistake. Thank
    you for your help.



    This is: "contact_form.p hp"



    <?
    // This is the beginning of the PHP code

    $name = $_POST['name'];
    $email = $_POST['email'];
    $comments = $_POST['comments'];
    $error_msg = "";
    $msg = "";


    if(!$email){
    $error_msg .= "Your email \n";
    }
    if($email){
    if(!eregi("^[a-zA-Z0-9_\.\-]+@[a-zA-Z0-9\._\-]+\.[a-zA-Z]{2,4}", $email)){
    echo "\n<br>That is not a valid email address. Please <a
    href=\"javascri pt:history.back ()\">return</a> to the previous page and try
    again.\n<br>";
    exit;
    }
    $msg .= "Email: \t $email \n";
    }

    if($comments){
    $msg .= "Comments: \t $comments \n";
    }
    $sender_email=" ";

    if(!isset($name )){
    if($name == ""){
    $sender_name="W eb Customer";
    }
    }else{
    $sender_name=$n ame;
    }
    if(!isset($emai l)){
    if($email == ""){
    $sender_email=" Customer@websit e.com";
    }
    }else{
    $sender_email=$ email;
    }
    if($error_msg != ""){
    echo "You didn't fill in these required fields:<br>"
    .nl2br($error_m sg) .'<br>Please <a
    href="javascrip t:history.back( )">return</a> to the previous page and try
    again.';
    exit;
    }
    $mailheaders = "MIME-Version: 1.0\r\n";
    $mailheaders .= "Content-type: text/plain; charset=iso-8859-1\r\n";
    $mailheaders .= "From: $sender_name <$sender_email> \r\n";
    $mailheaders .= "Reply-To: $sender_email <$sender_email> \r\n";
    mail("your@emai l.com","Contact Us"stripslashes ($msg), $mailheaders);
    header("Locatio n: http://yahoo.com/"); /* Redirect browser */
    $myname = "Your Name Here";
    $mymail = "your@email.com ";
    $subject = "Thank you for your mail!";
    $body = "Hi. This is an auto response to let you know that I've successfully
    received your
    email sent through my email form @ mywebsite.com. Thanks! I'll get back to
    you
    shortly.";
    $headers = "Content-Type: text/plain; charset=us-ascii From: $myname
    <$mymail> Reply-To: <$mymail> Return-Path: <$mymail> X-Mailer: PHP";
    if ($email != "") { mail($email,$su bject,$body,$he aders); }

    //This is the end of the PHP code
    ?>

    And this is a simple "contact form" for the script.


    <!-- BEGIN THE COPYING HERE!!!!!!! --><!-- beginning of the form -->
    <form METHOD=POST ACTION="contact _form.php">
    <table width="300" border="0" cellspacing="0" cellpadding="0" >
    <tr><td>Name: </td><td>&nbsp;<I NPUT TYPE="text" NAME="name"></td></tr>
    <tr><td>E-mail:</td><td>&nbsp;<I NPUT TYPE="text" NAME="email"></td></tr>
    <tr><td valign="top">Co mments:</td><td><TEXTARE A NAME="comments" ROWS="10"
    COLS="34"></TEXTAREA></td></tr>
    <td><br><inpu t type="submit" name="Submit" value="Submit"> </td>
    <td><br>
    <input type="reset" name="reset" value="Reset"></td></tr></table>
    </form>
    <!--end of the form -->
    <!-- END THE COPYING HERE!!!!!!! -->


  • Geoff Berrow

    #2
    Re: Form Autoresponder.

    I noticed that Message-ID: <DJ6dndJaYLeBV7 beRVn-oQ@rogers.com> from Andy
    contained the following:
    [color=blue]
    >I need your help to check if my autoresponder will work in the following
    >script. I am testing my PHP scripts on free server, which dosen't allow me
    >to send email letters from my website.[/color]

    The chances are that your server will not allow this since it would be
    too easy for spammers to abuse your script.

    --
    Geoff Berrow (put thecat out to email)
    It's only Usenet, no one dies.
    My opinions, not the committee's, mine.
    Simple RFDs http://www.ckdog.co.uk/rfdmaker/

    Comment

    • Andy

      #3
      Re: Form Autoresponder.


      "Geoff Berrow" <blthecat@ckdog .co.uk> wrote in message
      news:knoni1ts12 cg1v7rftf8p2v9p 981lsbobe@4ax.c om...[color=blue]
      >I noticed that Message-ID: <DJ6dndJaYLeBV7 beRVn-oQ@rogers.com> from Andy
      > contained the following:
      >[color=green]
      >>I need your help to check if my autoresponder will work in the following
      >>script. I am testing my PHP scripts on free server, which dosen't allow me
      >>to send email letters from my website.[/color]
      >
      > The chances are that your server will not allow this since it would be
      > too easy for spammers to abuse your script.
      >
      > --
      > Geoff Berrow (put thecat out to email)
      > It's only Usenet, no one dies.
      > My opinions, not the committee's, mine.
      > Simple RFDs http://www.ckdog.co.uk/rfdmaker/[/color]

      Nope, most free servers have spam policy not to allow using email.
      How about autoresponder ? It will respond to letters or not ? If will work I
      can use it to other contact script which has better security, but doesn't
      have responder. This is why I need somebody to check if it works. Thanx.


      Comment

      • Geoff Berrow

        #4
        Re: Form Autoresponder.

        I noticed that Message-ID: <9pqdnZFA7_ka67 HeRVn-tg@rogers.com> from Andy
        contained the following:
        [color=blue]
        >Nope, most free servers have spam policy not to allow using email.
        >How about autoresponder ? It will respond to letters or not ? If will work I
        >can use it to other contact script which has better security, but doesn't
        >have responder. This is why I need somebody to check if it works. Thanx.[/color]

        It looks like it will work, but the autoresponder is a really bad idea.
        Didn't I make that clear?

        --
        Geoff Berrow (put thecat out to email)
        It's only Usenet, no one dies.
        My opinions, not the committee's, mine.
        Simple RFDs http://www.ckdog.co.uk/rfdmaker/

        Comment

        Working...