Astahost.com   Sep 3, 2010
  Open Discussion & Free Web Hosting > Computers & Tech > Programming > Scripting > PHP

How To Set Up Form Mail

ryan012


I am programming on a web site's contact form page, How can I mail the filled in information of the client to particular E-mail address? I tried form action="mailto:blah@blah", but it is running all right on my machine rather that other computer in our LAN. The error message I got is a connection failure error occurred. I noticed there are some form mail info on line, but I have no idea to figure out how is that works. Anybody have some experience on that? Thanks!

Comment/Reply (w/o sign-up)

wannabeeaweak
well from wut i uderstand i think wut u need to do is setup a cgi script that takes the stuff that people input and sends it to your email. or u can go u this web site and wut they do is u just sign up and u just read there stuff on how to do it and they offer u to just fill out the form and u can get a cgi that when people input the stuff it send it to your emal. well the site is i think the site is www.allforms.com

Comment/Reply (w/o sign-up)

farrooda
check this out
http://phpformgen.sourceforge.net

Comment/Reply (w/o sign-up)

overture
You can probably find something on the net. Look for "php sending emails mail()" this may bring up results. The Mail() bit is the function used to send the email along with the information that has been entered into the form. if u want my script then i will give it to you, but have a good stab at using the mail() function along with some security (htmlentities(), Strip_Tags()) and some validation so the email will not be sent if there is no message or email address or whatever.

Comment/Reply (w/o sign-up)

ryan012
Thank you for your guys' reply, finnally, I wrote my own php script and got the running. The code is attached below, it is simple and anybody got some security suggestions based on that? Like regular expression check

<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$message = stripslashes($message);

mail("blah@mail.co.nz",$subject,$message,
"From: $name <$email>\r\n" .
"Reply-To: $name <$email>\r\n" .
);

$message = str_replace("\n","<br>",$message);
echo "The following message was sent:<br><br>";
echo "<b>From:</b> $name <".$email."><br>";
echo "<b>Subject</b> $subject<br>";
echo "<br><b>Message:</b><br>$message";
echo "<br><br>";
echo "<b>Thank You For Sending Me A Comment</b>";
?>

 

 

 


Comment/Reply (w/o sign-up)


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

This textarea will convert to Rich-Text automatically (IE, Firefox, Chrome)

Similar Topics

Keywords : set, form, mail

  1. Using Php With A Mail Server
    (2)
  2. PHP: Need Help Sending Mail Using SMTP
    (5)
    While the mail() function of php is all bout simplicity, it lacks the otherwise necessary
    flexibility. How do I send an E-Mail using php through SMTP?....
  3. Php Send Mail Through Smtp
    (12)
    Can anyone here tell me how to send mail through SMTP server with php /mellow.gif"
    style="vertical-align:middle" emoid=":mellow:" border="0" alt="mellow.gif" /> I have search in many
    source code on web and cant find anything /sad.gif" style="vertical-align:middle" emoid=":("
    border="0" alt="sad.gif" />....
  4. E-mail List Error
    (4)
    I just coded this e-mail list, it works well for entering data into database, but if user leaves
    the field blank or adds an already exist e-mail it gives him the error message and stops loading the
    rest of the page. CODE // Connects to your Database mysql_connect("localhost", "my_username",
    "mypassword") or die(mysql_error()); mysql_select_db("Database name") or die(mysql_error()); //This
    code runs if the form has been submitted if (isset($_POST )) { //This makes sure they did not leave
    any fields blank if (!$_POST ) {die(' No e-mail added '); } ....
  5. Using The Php Mail() Function For Images Or Attachments
    Can't find a decent tutorial! (7)
    I read the one mail() tutorial that was posted in the tutorial section and to my horror found that
    he had quoted almost verbatim from the PHP Manual off php.net, and made a comment about it, and also
    found that if you were new to PHP or the Manual that it was informative but not indepth enough for
    my tastes. This is not a tutorial although with the code that will be posted it might look like
    one, that is not its intent or purpose. I have searched and found many so called tutorials about
    MIME mail and boundries and all that but basically it either told me to use PHPMai....
  6. Sending Mail To A Mailing List
    Possibility of sending a newsletter (12)
    Task : To send an email to a list of email addresses stored in a database Premise : Page is
    written in PHP, with the database as MySQL. The email addresses need to be taken from a column of a
    table in the database which is queried with some "WHERE" clause. The email sent to these addresses
    is static. Objective : To send a newsletter to the members who have subscribed for the same on a
    website. Well, there. I have put it as objectively and as clearly as possible. I have searched
    for the keywords "mail" and "PHP" on this section of the forum, and from what I have....
  7. Simple E-mail Validation
    check for correct address and syntax (2)
    Hey , this tutorial will tell you a very simple way to check if email addresses entered are with the
    correct syntax. Hope this will help you eliminate jokers. So this script will... (check the
    characters, and check if there is a " someone somewhere.extension ". Ok, so firstly we create a
    function with all the invalid stuff in it:- CODE function CheckMail($email) { if (eregi("^ ( ?
    )*@ ( ? )*\. {2,4}$", $email)) { return true; } else { return false; } } Now, to check an
    email you just run the variable with the email in it through the function as follow....
  8. Do You Want A Mail Form In Your Site
    (2)
    Notice from m^e: Repeat post. Credits reduced by 5 days. Learn to USE
    THE SEARCH BUTTON before you make such posts. did you want to have in your web site mail form
    that allow the user to send mails to anther mail from his mail e.g. the compose in yahoo CODE
    from to cc bcc subject
    function param($Name)         {         global
    $HTTP_POST_VARS;         if(isset($HTTP_POST_VARS ))            return($H....
  9. Form Mail Php - Use Php To Send Form Through Email
    (8)
    Just sends all form data to a specified email. Does anyone know a free script that does this?....
  10. Mail() Not Working
    (4)
    I'm trying to use the mail() function in a script. But it doesnt work. It keeps returning false.
    It's a premade script The code is: CODE function SendPassword($userName) { global
    $db,$db_tables;//config.php     // set password for username to a random value     // return the new
    password or false on failure     $new_password = mt_rand();     $qry = "UPDATE $db_tables SET
    password=password('$new_password') WHERE user_name='$userName'";
        $db->db_query($qry);     // send notification email     $from = "From: $from_email\r\n";
        $msg = "....

    1. Looking for set, form, mail

free web hosting



*SIMILAR VIDEOS*
Searching Video's for set, form, mail
advertisement




How To Set Up Form Mail

Affordable Web Hosting, Low cost Web Hosting - ComputingHost.com



Creative Commons License