Jump to content


Photo

RICH FORM SUBMISSION VIA SENDMAIL


  • Please log in to reply
1 reply to this topic

#1 tutwelve

tutwelve
  • New Members
  • Pip
  • Newbie
  • 3 posts

Posted 27 May 2006 - 01:21 AM

Hi all,

I'm very much a PHP newbie, so please forgive my ignorance throughout the following post.

WHAT I WANT TO DO:

I want the contents of a rich online html form to be sent to my personal e-mail address. I've searched online for tutorials regarding this matter but only find scripts that process "simple contact" forms. If I have a form that has more fields than subject, email and message(e.g. address, phone number, etc...) how can I get the contents of such a form sent directly to my email address?

Hopefully, I'm making myself clear....

Thanks ahead of time any assistance you can offer.

Sincerely,

TuTwelve

#2 Randy

Randy
  • Members
  • PipPip
  • Member
  • 25 posts
  • LocationNewcastle, UK

Posted 28 May 2006 - 08:58 PM

form.html
<HTML>
    <head>
        <title>
            Form
        </title>
    </head>
    <body>
        <form action="mail.php" method="POST">
            <input name="name">
            <br><input name="email">
            <br><input name="phone">
            <br><input type="submit" value="Send!">
        </form>
    </body>
</HTML>
mail.php
<?php
    $email = "your@email.adress";
    $subject = "Contact Form";
    $message = "Name: ".$_POST['name'];
    $message .= "\nEmail Adress: ".$_POST['email'];
    $message .= "\nTelephone: ".$_POST['phone'];
    $message = wordwrap($message, 70);
    mail($email, $subject, $message);
    echo("Thankyou for filling out the Form!");
?>
I hope this is what you wanted to do...

the email would look like:

Name: Bob
Email Adress: Bob@hotmail.com
Telephone: 0123 1234567




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users