Hi DPers , i am a newbie and i need some help . I am trying to set up a basic form with a text/ edit box , a drop down list and a submit button . I would like to know how i can configure the forum so that it submits to my mailbox . I would really appreciate your help P:S: I am a newbie so please explain in terms a "dummy" would understand lol.
Rather than type it all out watch this video Learn PHP (5) POST, GET, REQUEST - All you'd have to do is use a PHP mail() function after using POST from the form!
Simple, add your fields that you want information to in to the body of the code below. Add the code to your form submit; done. $to = "admin@mail.com"; $subject = "Site Submission"; $body = "$field1 \n $field2 \n $field3 \n $field4"; mail($to, $subject, $body);
If you are using a platform (like wordpress) then there are many plugins that are very easy to configure
if you don't want to use php, you can do similar task with HTML: <a href="mailto:your-mail">mail me</a>
<?php if(isset($_POST['email'])) { $headers = 'From: ".$_POST['from']. "\r\n"; mail($_POST['to'], $_POST['subject'], $_POST['message'], $headers); } ?> <form method="post" action =""> From : <input type="text" name="from"> To : <input type="text" name="to"> Subject : <input type="text" name="subject"> Message : <input type="text" name="message"> <input type="submit" /> </form>
be careful with this that's a quick way to get backlisted as spam... people will abuse this and cause you a lot of grief