Easy mail form script

SpaceshipSpaceship
SpaceshipSpaceship
Namecheap AuctionsNamecheap Auctions
Watch

listenmirndt

Established Member
Impact
0
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="[email protected]">
  </div>
</form>
</body>
</html>

Change [email protected] to your email address

then,

mail.php
PHP:
<?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 
        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.
 
0
Close
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
Just wondering where you got this script from?
 
0
Close
0
Close
Just because I like to know who wrote it, that's all. :)
 
0
Close
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>";
 
0
Close
You should add an IP sniffer to that for security reasons.
 
0
Close
DomainEasy: flexible LTO options. Close more domain deals with financing.

We're social

Escrow.com
Spaceship
Domain Recover
CryptoExchange.com

NamePros updates

Switch between accounts
You can now stay logged in to more than one NamePros account in the same browser. Click your avatar, then "Accounts in this browser", to...
AIVikings
Catchy
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back