hey all,

I have a form that allows the user to input the information
you can see it here- http://www.christiancouriernewspaper.com/blogbase/form.html

what I need it to do now is when the user clicks SUBMIT for all the information they just filled out be sent to me via e-mail

any ideas/help?

thanks

Recommended Answers

All 7 Replies

As far as I know there is no way to send mail using HTML only. I believe you can launch the default mail program but not sure if you can fill in anything other than the email address. Hopefully someone else on here knows the secret but I am pretty sure it can't be done with only HTML.

Sorry friend.

As far as I know there is no way to send mail using HTML only. I believe you can launch the default mail program but not sure if you can fill in anything other than the email address. Hopefully someone else on here knows the secret but I am pretty sure it can't be done with only HTML.

Sorry friend.

well then do you have a contact form.php and script I could use that I could customize and then when the user submits have it sent via email?

thanks for your quick reply

Sorry but I am a .net guy. Here is a link to one that might work for you though here

Good luck

hi
below i am sending you a code in php u can do sooo
//Starts of code

<?php 	
		  $recipient = 'abc@gmail.com';
		  $subject='Enquiry Form Records';
		  $name = stripslashes($_POST['name']);
		  $email = stripslashes($_POST['email']);
		  $email_from =$_POST['email'];
		  $service = stripslashes($_POST['service']);
		  $query = stripslashes($_POST['query']);		  
		  $phone = stripslashes($_POST['phone']);		 
		  $ip=$_SERVER['REMOTE_ADDR'];
		  $it=gmdate("H:i:s", time());
		  $d=gmdate("d-M-Y", time());		 
		  $headers .="From: $email_from \r\nMIME-Version: 1.0\r\nContent-type:text/html;charset=iso-8859-1";
		 		  $msg="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Untitled Document</title>
</head>
<body>
<table width='280' border='0' cellpadding='3' cellspacing='1' style='border:1px; solid; #000000;'>
  <tr>
    <td colspan='2' bgcolor='#666666' style='font:arial;font-size:12px;font-weight:bold;color:#ffffff'>Client Information</td>
  </tr>
  <tr>
    <td width='40%' bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Full Name </td>
    <td width='60%' bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$name</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Email</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$email</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Service</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$service</td>
  </tr>
   <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Message</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$query</td>
  </tr> 
  <tr>
    <td colspan='2' bgcolor='#666666' style='font:arial;font-size:12px;font-weight:bold;color:#ffffff'>Additional Information</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Date</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$d</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Time </td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$it</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>IP Address</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$ip</td>
  </tr>
</table>
</body>
</html>";	
	
	 $sent = mail($recipient, $subject, $msg, $headers, '-f .$email_from');	
?>
//end of code

hey all,

I have a form that allows the user to input the information
you can see it here- http://www.christiancouriernewspaper.com/blogbase/form.html

what I need it to do now is when the user clicks SUBMIT for all the information they just filled out be sent to me via e-mail

any ideas/help?

thanks

Sorry, browsing two threads het reply in wrong one

**wrong answer removed**

hi
below i am sending you a code in php u can do sooo
//Starts of code

<?php 	
		  $recipient = 'abc@gmail.com';
		  $subject='Enquiry Form Records';
		  $name = stripslashes($_POST['name']);
		  $email = stripslashes($_POST['email']);
		  $email_from =$_POST['email'];
		  $service = stripslashes($_POST['service']);
		  $query = stripslashes($_POST['query']);		  
		  $phone = stripslashes($_POST['phone']);		 
		  $ip=$_SERVER['REMOTE_ADDR'];
		  $it=gmdate("H:i:s", time());
		  $d=gmdate("d-M-Y", time());		 
		  $headers .="From: $email_from \r\nMIME-Version: 1.0\r\nContent-type:text/html;charset=iso-8859-1";
		 		  $msg="<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'>
<html xmlns='http://www.w3.org/1999/xhtml'>
<head>
<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1' />
<title>Untitled Document</title>
</head>
<body>
<table width='280' border='0' cellpadding='3' cellspacing='1' style='border:1px; solid; #000000;'>
  <tr>
    <td colspan='2' bgcolor='#666666' style='font:arial;font-size:12px;font-weight:bold;color:#ffffff'>Client Information</td>
  </tr>
  <tr>
    <td width='40%' bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Full Name </td>
    <td width='60%' bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$name</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Email</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$email</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Service</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$service</td>
  </tr>
   <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Message</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$query</td>
  </tr> 
  <tr>
    <td colspan='2' bgcolor='#666666' style='font:arial;font-size:12px;font-weight:bold;color:#ffffff'>Additional Information</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Date</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$d</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>Time </td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$it</td>
  </tr>
  <tr>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>IP Address</td>
    <td bgcolor='#F7F7F7' style='font:arial;font-size:12px'>$ip</td>
  </tr>
</table>
</body>
</html>";	
	
	 $sent = mail($recipient, $subject, $msg, $headers, '-f .$email_from');	
?>
//end of code

does this code also send the data posted in a e-mail to me??
thanks for the reply

It will if its your your address in the "RECIPIENT" variable
z could have written

<?php
  $recipient = 'abc@gmail.com'; // configurable
  $subject='Enquiry Form Records'; //configurable

you get used to it

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.