Version: 1.1
Type: Full Script
Category: Networking
License: GNU General Public License
Description: This script can be used to send mails from text entered in a form.. It is sent in HTML format.
<?php /* DESCRIPTION : To Send Emails from Forms in HTML format using php AUTHOR : Gordon Thomas <[email protected]> COMMENTS : 1. Change "your_name" to sender's name 2. Change "your_login" to sender's login 3. Change "your_domain_name" to sender's domain name 4. Change "recipient_login" to recipient's login 5. Change "recipient_domain_name" to recipient's domain name */ $todaysDate = date ("d.m.y", time ()); $TO = "recipient_login@recipient_domain_name"; $CC = "recipient_login@recipient_domain_name"; $MP = "/usr/sbin/sendmail -t"; if ($formFill){ $fd = popen($MP,"w"); fputs($fd, "To: $TOn"); fputs($fd, "Cc: $CCn"); fputs($fd, "From: your_name <your_login@your_domain_name>n"); fputs($fd, "Subject: subject n"); fputs($fd, "X-Mailer: PHPn"); fputs($fd, "Content-Type: text/html; charset=us-asciin"); fputs($fd, "Content-Transfer-Encoding: 7bitn"); fputs($fd, "<body bgcolor="#9fb6cd">n"); fputs($fd, "<b><u>Text Area 1</u>:</b>$workn"); fputs($fd, "<br>n"); fputs($fd, "<br>n"); fputs($fd, "<b><u>Text Area 2</u>:</b>$deadlinen"); fputs($fd, "<br>n"); fputs($fd, "<br>n"); fputs($fd, "<b><u>Text Area 3</u>:</b>$learntn"); fputs($fd, "<br>n"); fputs($fd, "<br><hr><br>n"); fputs($fd, "Regards,<br>your_name<br>n"); fputs($fd, "</body>n"); pclose($fd); exit; }else{ echo "<html>"; echo "<body bgcolor="#000000">"; echo "<font color="skyblue"><b><u>DATE : $todaysDate</u></b></font><br><br><br>"; echo "<form method="post" action="this_files_name.php">"; echo "<table width="90%" align=center cellspacing=1 cellpadding=0 border=0 bgcolor="#415f6c">"; echo "<tr>"; echo "<td align=center><font color="#ffffff"><b>Text Area 1</b></font></td>"; echo "<td align=center><textarea rows=5 cols=40 name="work"><br></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td align=center><font color="#ffffff"><b>Text Area 1</b></font></td>"; echo "<td align=center><textarea rows=5 cols=40 name="deadline"><br></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td align=center><font color="#ffffff"><b>Text Area 1</b></font></td>"; echo "<td align=center><textarea rows=5 cols=40 name="learnt"><br></textarea></td>"; echo "</tr>"; echo "<tr>"; echo "<td align=center>"; echo "<input type="hidden" name="formFill" value="formmail">"; echo "<input type="submit" value="Send Mail">"; echo "</td>"; echo "<td align="right" bgcolor="#000000">"; echo "<font color="skyblue"><b>"; echo "© Gordon Thomas"; echo "<b></font>"; echo "</td>"; echo "</tr>"; echo "</table>"; echo "</form>"; echo "</body>"; echo "</html>"; } ?>