MikdadAli's Posts
Nairaland Forum / MikdadAli's Profile / MikdadAli's Posts
(1) (of 1 pages)
Webmasters / Re: How To Create An Autoresponder In An Html Form by MikdadAli: 6:23am On Dec 30, 2015 |
xclusiv: 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 ur 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 not working got systax error pls help me |
(1) (of 1 pages)
(Go Up)