NamePros
Welcome, Guest! Ready to make a name for yourself in the domain business? We welcome both the hobbyist and professional domainer to join the discussion as part of the NamePros community.

Click here to create your profile to start earning reputation for posting, and trader ratings for buying & selling in our free e-marketplace. Build your trader rating with each successful sale. Our system has tracked over 100,000 sales and counting!
FAQ & TOS Register Search Today's Posts Mark Forums Read

Go Back   NamePros.com > Website Development Discussion Forums > Programming > CODE
Reload this Page Easy mail form script

CODE This forum is for posting code snippets and example scripts that aren't quite tutorials, but could be useful for others. You may post code snippets and/or completed scripts that you've written and want to share here.

Advanced Search


Closed Thread
 
LinkBack Thread Tools
Old 03-03-2004, 12:04 AM THREAD STARTER               #1 (permalink)
New Member
Join Date: Mar 2004
Posts: 18
listenmirndt is an unknown quantity at this point
 



Easy mail form script


First the form :

mailform.htm
Code:
<html>
<head>
<title>Send Mail</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<form name="form1" method="post" action="mail.php">
  <div align="center">
<table cellspacing="1" cellpadding="3" border="6" bordercolor="#F9F9F9" bgcolor="#CCCCCC">
      <tr bgcolor="#F9F9F9"> 
        <td> 
          <div align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1">Your 
            Email </font></div>
        </td>
        <td> 
          <div align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1">Message</font></div>
        </td>
      </tr>
      <tr> 
        <td bgcolor="#FFFFFF"> 
          <div align="center"><font color="#000000"><b> 
            <input type="text" name="from" size="20" value="">
            </b></font></div>
        </td>
        <td bgcolor="#FFFFFF" rowspan="3"><font color="#000000"><b> 
          <textarea name="message" cols="20" rows="5"></textarea>
          </b></font></td>
      </tr>
      <tr> 
        <td bgcolor="#F9F9F9"> 
          <div align="center"><font color="#000000" face="Verdana, Arial, Helvetica, sans-serif" size="1">Subject</font></div>
        </td>
      </tr>
      <tr> 
        <td bgcolor="#FFFFFF"> 
          <div align="center"><font color="#000000"><b> 
            <input type="text" name="subject" size="20" value="">
            </b></font></div>
        </td>
      </tr>
    </table>
    <table cellspacing="1" cellpadding="3" border="6" bordercolor="#F9F9F9" bgcolor="#CCCCCC">
      <tr bgcolor="#F9F9F9"> 
        <td> 
          <div align="center"><font color="#000000"> 
            <input type="submit" name="Send" value="Send">
            </font></div>
        </td>
      </tr>
    </table>
    <input type="hidden" name="to" value="YOU@YOURDOMAIN.COM">
  </div>
</form>
</body>
</html>
Change YOU@YOURDOMAIN.COM to your email address
????: NamePros.com http://www.namepros.com/code/22403-easy-mail-form-script.html

then,

mail.php
PHP Code:
<?php

$from 
$_POST['from'];
$subject $_POST['subject'];
$message $_POST['message'];
$to $_POST['to'];

$to="$to";
$headers.= "MIME-Version: 1.0\r\n";
$headers.= "Content-type: text/html; ";
$headers.= "charset=iso-8859-1\r\n";

$headers.= "From: $from";

$subject "$subject";
$body "$message";

$send_check=mail($to,$subject,$body,$headers);
if (
$send_check!=true) {
die();
}

?>

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

<body bgcolor="#FFFFFF" text="#000000">
<table cellspacing="1" cellpadding="3" border="6" bordercolor="#F9F9F9" bgcolor="#CCCCCC" align="center">
  <tr bgcolor="#F9F9F9"> 
    <td> 
      <div align="center"><font color="#000000"><b><font color="#000000"><b><font color="#000000"><b><font face="Verdana, Arial, Helvetica, sans-serif" size="1">YOUR 
        MESSAGE HAVE BEEN SENT<br>
        <br>
        </font></b></font></b></font></b><font color="#000000"><font color="#000000"><font face="Verdana, Arial, Helvetica, sans-serif" size="1">Will 
????: NamePros.com http://www.namepros.com/showthread.php?t=22403
        will respond as soon as we can. Thank-You</font></font></font></font></div>
    </td>
  </tr>
</table>
</body>
</html>
upload both files and your done.
__________________
Mirndtsoft PHP Scripts | Featuring Automation for Paypal - Digital Goods, Ebay, Memberships, & Web Hostingwww.mirndtsoft.com
listenmirndt is offline  
Old 03-03-2004, 02:33 AM   #2 (permalink)
NamePros Expert
 
Anthony's Avatar
Join Date: Dec 2003
Location: NYC
Posts: 9,134
Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future
 

Member of the Month
October 2004

Just wondering where you got this script from?
Anthony is offline  
Old 03-03-2004, 02:34 AM THREAD STARTER               #3 (permalink)
New Member
Join Date: Mar 2004
Posts: 18
listenmirndt is an unknown quantity at this point
 



From my site, www.mirndtsoft.fw-e.com . why?
__________________
Mirndtsoft PHP Scripts | Featuring Automation for Paypal - Digital Goods, Ebay, Memberships, & Web Hostingwww.mirndtsoft.com
listenmirndt is offline  
Old 03-15-2004, 12:11 AM   #4 (permalink)
NamePros Expert
 
Anthony's Avatar
Join Date: Dec 2003
Location: NYC
Posts: 9,134
Anthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant futureAnthony has a brilliant future
 

Member of the Month
October 2004

Just because I like to know who wrote it, that's all.
Anthony is offline  
Old 03-15-2004, 12:31 AM   #5 (permalink)
NamePros Member
Join Date: Nov 2003
Posts: 44
Pablo is an unknown quantity at this point
 



Just so others know It can be sent with HTML. so to add html to the email you just simply add....

$body = "
<html><body>
<table width=60% border=1 cellpadding=0 cellspacing=0>
<tr>
<td> $message </td>
</tr>
</table>
</html></body>";
__________________
Click Link for Java IRC

PHP-Live IRC: pgardner.net:6667, Channel: #php.
Pablo is offline  
Old 04-19-2004, 03:13 PM   #6 (permalink)
Account Suspended
 
BoRiCuA's Avatar
Join Date: Apr 2004
Location: Connecticut
Posts: 586
BoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really niceBoRiCuA is just really nice
 



You should add an IP sniffer to that for security reasons.
BoRiCuA is offline  
Closed Thread


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools


Liquid Web Smart Servers  
All times are GMT -7. The time now is 03:18 AM.

Managed Web Hosting by Liquid Web
Domain name forum recommended by Domaining.com Powered by: vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.6.0 Ad Management plugin by RedTyger