#native_company# #native_desc#
#native_cta#

E-mail pager

By Dmitry Sokolov
on July 19, 2002

Version: 0.93

Type: Full Script

Category: Other

License: GNU General Public License

Description: Simple as possible e-mail pager.
Support parameters in command line
and cookie.

<?  
$ver=0.93;
///////////////////////////////////////////////////////////////////
// Simple mail pager by BreeZe (mailto:[email protected]) [GNU]        //
// Note: do not lose to init SMTP-server in your php.ini !!!     //
///////////////////////////////////////////////////////////////////
// Clearing cookie, if user asks for it
if (@$clear and $clear==True)
	{
		setcookie ("c_to"); 
		setcookie ("c_subj"); 
		setcookie ("c_msg"); 
		echo "<center>Cookies deleted. (Auto-save every time you press [submit] button.   </center>";
	}
// Saving cookie for next time ;-)
else if (@$save and @$to and @$subj and @$msg and $save==True) 
	{
		setcookie ("c_to", $to); 
		setcookie ("c_subj", $subj); 
		setcookie ("c_msg", $msg); 
//		echo "<center>Cookies saved.</center>";  // debug
	};
?>

<html> 
<head> <title> Simple e-mail pager by BreeZe v<? echo $ver; ?></title> </head>
<body bgcolor=#cccccc text=black> 
<table align=center border=0 bgcolor=#bbbbbb> <tr> <td> 

<h1><center>E-mail pager by BreeZe v<? echo $ver; ?> [GNU]</center></h1>
<center>
<? 
// If exist cookie but not exist params in url'line
	if (@!$to and @$c_to) $to=$c_to;
	if (@!$subj and @$c_subj) $subj=$c_subj;
	if (@!$msg and @$c_msg) $msg=$c_msg;

if (@!$to or @!$subj or @!$msg or @!$save) echo "
<form action=mail.php method=get>
	<table border=0 bgcolor=#cccccc cellspacing=2 cellpadding=2>
	<tr> <td align=right> to  </td> 	<td> <input name=to type=text value="$to" size=20> (past e-mail here)	</td> </tr>
	<tr> <td align=right> subject </td> 	<td> <input name=subj type=text value="$subj" size=40> 	</td> </tr>
	<tr> <td valign=top align=right> massage </td> 	<td> <TEXTAREA NAME='msg' ROWS='7' COLS='40' WRAP='SOFT'>$msg</TEXTAREA></td> </tr>
	<tr> <td align=right> &nbsp; </td> 	<td> <input type='CHECKBOX' NAME='save' VALUE='1' CHECKED> Save cookies </td> </tr>
	<tr> <td align=center colspan=2 > <input value="send it!" type=submit>	</td> </tr>
	</table>
</form>
<center>
<form action="mail.php" method=get>       
	<input name=clear type=hidden value=1>	
 	<input value="Clear cookies." type=submit>
</form>
</center>";
else
{
	mail($to, $subj, $msg);
	echo "<p>Mail to <b>".$to."</b> about <i>".$subj."</i> successefully sended! <br>
	<i> (If warning about "bad destination" appeared, it seems that you enter <b>incorrect e-mail</b>.)</i><br>
	Thanx you for using this script!</p>";
}
?>
</center>

</html>