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 9 of 9

Thread: Email sender.

  1. #1
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Email sender.

    I haven't been able to find a script for a form that will make peopel able to send mail to me... Anyone know where I can get one/explain how to make one?

  • #2
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    PHP Code:
    orm.html
    <form action="process.php" method="post">
    Name:<input type="text" name="name" /><br />
    Email:<input type="text" name="email" /><br />
    Phone:<input type="text" name="phone" /><br />
    Comments:<textarea name="comments"></textarea>
    </form>

    process.php
    <?php
    $name 
    $_POST['name'];
    $body $_POST['comments'];
    $email $_POST['email'];
    $phone $_POST['phone'];
    $headers "From: $email Phone: $phone";
    $mailContent="--------CONTACT--------\n"
         
    ."Name: ".$name."\n"
         
    ."E-mail: ".$email."\n"
         
    ."Phone: ".$phone."\n"
         
    ."Comment/Inquiry: ".$body."\n";
    $toAddress="youremail";
    $subject="Email from your contact form!";
    mail($toAddress,$subject,$mailContent,"From:$email");
    ?>

  • #3
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So how do I put that into a page...?

    (Also, I don't need phone numbers.)

  • #4
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    two different pages, form.html and process.php

  • #5
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Can I save it as form.php?

    (Also, how do I make a submit button for it?)
    Last edited by Ranger56; 06-09-2005 at 05:19 AM.

  • #6
    Regular Coder
    Join Date
    Mar 2005
    Posts
    111
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok look, put this code into form.html
    <form action="process.php" method="post">
    Name:<input type="text" name="name" /><br />
    Email:<input type="text" name="email" /><br />
    Comments:<textarea name="comments"></textarea>
    </form>

    and then put this code into process.php
    PHP Code:
    <?php
    $name 
    $_POST['name'];
    $body $_POST['comments'];
    $email $_POST['email'];
    $headers "From: $email Phone: $phone";
    $mailContent="--------CONTACT--------\n"
         
    ."Name: ".$name."\n"
         
    ."E-mail: ".$email."\n"
         
    ."Comment/Inquiry: ".$body."\n";
    $toAddress="your@email";
    $subject="Email from your contact form!";
    mail($toAddress,$subject,$mailContent,"From:$email");
    ?>

  • #7
    Regular Coder Ranger56's Avatar
    Join Date
    Mar 2005
    Location
    Kent, WA.
    Posts
    783
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yeah yeah, I got that. I just need a submit button now...

  • #8
    Regular Coder
    Join Date
    Feb 2005
    Location
    Tokyo, Japan
    Posts
    151
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Throw this inside the <form>:

    Code:
    <input type="submit" name="Mail" value="Mail" />
    Yak

  • #9
    Regular Coder
    Join Date
    Nov 2004
    Location
    The Netherlands
    Posts
    551
    Thanks
    0
    Thanked 0 Times in 0 Posts
    CATdude about IE6: "All your box-model are belong to us"


  •  

    Posting Permissions

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