How To Create An Autoresponder In An Html Form

Welcome. Please Login, Register, Or Activate! 
type your username and password to login
Date: November 22, 2009, 06:02 PM
430875 members and 297964 Topics
Latest Member: aniesky
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderators: OmniPotens, yawa-ti-de)  |  How To Create An Autoresponder In An Html Form
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: How To Create An Autoresponder In An Html Form  (Read 396 views)
gimbasule
How To Create An Autoresponder In An Html Form
« on: November 20, 2008, 08:22 PM »

hi, good people in the house. i am designing a site that involve autoresponder to a message but am stranded i dont know how to go about it and i have only this weekend to round up the job. please i want some one in the house to  help. i have try all i could but nothing positive cameup.thanks and god bless
Seton (m)
Re: How To Create An Autoresponder In An Html Form
« #1 on: November 21, 2008, 03:52 PM »

why not try your hosting plan, 'cos autoresponders are always in the cpanel- mail  functions. goodluck
pie1ect (m)
Re: How To Create An Autoresponder In An Html Form
« #2 on: November 21, 2008, 04:17 PM »

You cannot create an auto-responder using HTML.
The easiest way to go about it would be to configure your email client (yahoo, gmail, hotmail, outlook or whatever you use) to auto-respond to an email which meets certain criteria which are defined by the incoming mail from your form.

That sounds like gibberish, I know. It does for me too. Grin

The point is this

Create your HTML form for your site
Allow the form data to be sent to an email address
Set the email to have a particular criteria (address  or title or content or specific key) which can be used to distinguish it from others coming into your inbox
Configure your email client to filter and respond to that email (anytime it comes in) when it comes in.
There you have it, your basic autoresponder.

I would go with a more sophistiated tool, like the one provided by your hosting provider.
xclusiv (m)
Re: How To Create An Autoresponder In An Html Form
« #3 on: November 21, 2008, 05:04 PM »

to auto respond to create an autoresponder in php

you can add a form function to the form with the form action directed at another page, then u can use the following php script to create the autoresponder, note that you will need to create a separate HTML Page that will hold the autoresponder message

<html>
<head>
<title>page title</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">

</head>
<body>

<?php
/* Code Developed by Abiodun Ogunibe. Copyright 2007. All Rights Reserved*/

/* subject */
$subject = "Feedback Form Submission, with autoresponder.";

/* message */
$message='The following information were submitted on ' . date("F j, Y, g:i a") . ' through the feedback form' ."\r\n".
'==============================================================='."\r\n".
/*the variable name in the POST[] title depends on the name u give your form field*/
'Title:            ' . $_POST[title] . "\r\n".
'First Name:      ' . $_POST[firstname] ."\r\n".
'Surname:         ' . $_POST[surname] ."\r\n".
'Position:         ' . $_POST[position] ."\r\n".
'Company:         ' . $_POST[company] ."\r\n".
'Address:         ' .$_POST[address] ."\r\n".
'Tel:            ' .$_POST[phone] ."\r\n".
'E-mail:          ' .$_POST[email] ."\r\n".
'Comments:         ' .$_POST[message] ."\r\n".
'======================SYSTEMS DETAILS=========================='."\r\n".
'IP:      '.$_SERVER[REMOTE_ADDR] ."\r\n".
'User Agent:   '.$_SERVER[HTTP_USER_AGENT]."\r\n";

/* Send Reply to E-Mail <strong></strong>*/
$headers = "From: " . $_POST[email]. "\r\n";
mail("info@yourwebsite.com", $subject, $message, $headers);

$message = '<font size="2" face="Arial, Helvetica, sans-serif">'.'Dear ' . $_POST[name] . ',' . '<p></p>';
/*the feedback.html is the autoresponder that u want to send*/
$message .= implode ('', file ('feedback.html'));

$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: Your Company's Name <info@yourwebsite.com>\r\n";

/* and now mail it */
$subject = "Your Comment/Question.";
mail($_POST[email], $subject, $message, $headers);

?>

<script>
   window.location="contact_reply.html"
</script>

</body>
</html>

save the message as .PHP and reference the page using the form action control, if u use formfield in HTML
regaltopax (m)
Re: How To Create An Autoresponder In An Html Form
« #4 on: November 22, 2008, 08:13 PM »

thanks guys.how do i link my form to submit via email.
OmniPotens (m)
Re: How To Create An Autoresponder In An Html Form
« #5 on: November 22, 2008, 08:38 PM »

Quote from: regaltopax on November 22, 2008, 08:13 PM
thanks guys.how do i link my form to submit via email.

If you know your mail function for PHP well, then you don't have any much questions to be asking here. Well, try the below for a simple contact page.

The following is a lite version of the form:

<form method="POST" action="mailer.php">
   <input type="text" name="name" size="19"><br>
   <br>
   <input type="text" name="email" size="19"><br>
   <br>
   <textarea rows="9" name="message" cols="30"></textarea>
   <br>
   <br>
   <input type="submit" value="Submit" name="submit">
</form>

Note the code that is colored in blue. The blue colored words will be useful for us.

So, here is our PHP code. You should place the following code into a new file you create called mailer.php.

<?php
if(isset($_POST['submit'])) {
$to = "you@you.com";
$subject = "Form Tutorial";
$name_field = $_POST['name'];
$email_field = $_POST['email'];
$message = $_POST['message'];
 
$body = "From: $name_field\n E-Mail: $email_field\n Message:\n $message";
 
echo "Data has been submitted to $to!";
mail($to, $subject, $body);
} else {
echo "OmniPotens!";
}
?>

Hope you understand it. Ask questions if confused especially about other fields not featured.

 I Need A Merger!  Looking To Advertise For 4 Months On Nigerian Websites And Blogs  Nairahost Again! Why Now  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 


Sections: Autos/Cars (2) Jobs/Vacancies (2) (3) Career Talk Education General(2) Politics Romance Computers Phones Travel
Sports Fashion Health Religion Celebrities TV/Movies (2) Music/Radio (2) Books Webmasters Programming

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa. See also: Nairalist Classified Ads
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.