CODE:
<html>
<head>
<title>Z-Mailer 1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style>
body {scrollbar-face-color: #25496D; scrollbar-highlight-color: #25496D; scrollbar-shadow-color: #DFDFDF; scrollbar-3dlight-color: #DFDFDF; scrollbar-arrow-color: #DFDFDF; scrollbar-track-color: #153A5F; scrollbar-darkshadow-color: #153A5F;}
a {color: #DFDFDF; text-decoration: none;}
a:hover {text-decoration: none;}
td {font-family: Tahoma; font-size: 7pt; color: #DFDFDF; border: #DFDFDF 1px solid; background-color: #153A5F; letter-spacing: 1.2pt;}
textarea,input,select {font-family: tahoma; font-size:10px; color: #DFDFDF; border: #DFDFDF 1px solid; background-color: #25496D;}
</style>
</head>
<body bgcolor="#153A5F">
<script language="JavaScript">
function maxlength_lang(form){
var maxlength=1000;
str=form.message.value;
dlina=str.length;
if(dlina>maxlength)form.message.value=str.substring(0,maxlength);
form.lang.value=(maxlength-dlina);}
required = new Array("mailto", "mailfrom", "subject", "message");
required_show = new Array("Кому", "От кого", "Тема", "Сообщение");
function SendForm () {
var i, j;
for(j=0; j<required.length; j++) {
for (i=0; i<document.forms[0].length; i++) {
if (document.forms[0].elements[i].name == required[j] && document.forms[0].elements[i].value == "" ) {
alert('Вы не заполнили форму "' + required_show[j] + '"');
document.forms[0].elements[i].focus();
return false;
}
}
}
return true;
}
</script>
<table width="40%" align="center" border="0" cellspacing="5" cellpadding="0">
<tr>
<td height="20" align="center" style="background-color: #25496D;">
<b>Z-Mailer 1.0</b>
<tr>
<td height="120" align="center">
<form name="sender" method="post" action="<?php echo $PHP_SELF; ?>?send" onsubmit="return SendForm();">
Кому<BR><input type="text" name="mailto" size="50"><BR>
От кого<BR><input type="text" name="mailfrom" size="50"><BR>
Тема<BR><input type="text" name="subject" size="50"><BR><BR>
<tr><td height="30" align="center">
Кодировка <select name="select_charset">
<option value="win">Win</option>
<option value="koi"> Koi</option>
<option value="iso"> Iso</option>
<option value="dos"> Dos</option>
<option value="mac"> Mac</option>
<select>
Доступно <input type="text" name="lang" size="2" value="1000"> символов<BR>
<tr><td height="200" align="center" valign="bottom">
<textarea name="message" rows="10" cols="70" onChange="maxlength_lang(document.sender)" onKeyUp="maxlength_lang(document.sender)" onKeyDown="maxlength_lang(document.sender)" onClick="maxlength_lang(document.sender)" onKeyPress="maxlength_lang(document.sender)"></textarea><BR><BR><BR>
<input type="submit" name="submit" style="width: 90pt; cursor: hand;" value="Отправить"> <input type="reset" name="reset" style="width: 90pt; cursor: hand;" value="Очистить">
</form></table>
<?php
if ($QUERY_STRING=="send"):
global $mailto, $subject, $message, $mailfrom, $select_charset, $charset;
switch ($select_charset){
case "win" : $charset="windows-1251";
break;
case "koi" : $charset="koi8-r";
break;
case "iso" : $charset="iso8859-5";
break;
case "dos" : $charset="x-cp866";
break;
case "mac" : $charset="x-mac-cyrillic";
break;
}
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=$charset\r\n";
$headers .= "Date: ".date("m.d.Y (H:i:s)",time())."\r\n";
$headers .= "From: $mailfrom\r\n";
$headers .= "X-Mailer: Z-Mailer 1.0\r\n";
if (mail($mailto,$subject,$message,"$headers")) {
print ("<script language='JavaScript'> alert(\"Письмо отправлено!\"); </script>");
}else{
print ("<script language='JavaScript'> alert(\"Ошибка: Письмо не может быть отправлено!\"); </script>");
}
endif;
?>
</body>
</html>
<head>
<title>Z-Mailer 1.0</title>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1251">
<style>
body {scrollbar-face-color: #25496D; scrollbar-highlight-color: #25496D; scrollbar-shadow-color: #DFDFDF; scrollbar-3dlight-color: #DFDFDF; scrollbar-arrow-color: #DFDFDF; scrollbar-track-color: #153A5F; scrollbar-darkshadow-color: #153A5F;}
a {color: #DFDFDF; text-decoration: none;}
a:hover {text-decoration: none;}
td {font-family: Tahoma; font-size: 7pt; color: #DFDFDF; border: #DFDFDF 1px solid; background-color: #153A5F; letter-spacing: 1.2pt;}
textarea,input,select {font-family: tahoma; font-size:10px; color: #DFDFDF; border: #DFDFDF 1px solid; background-color: #25496D;}
</style>
</head>
<body bgcolor="#153A5F">
<script language="JavaScript">
function maxlength_lang(form){
var maxlength=1000;
str=form.message.value;
dlina=str.length;
if(dlina>maxlength)form.message.value=str.substring(0,maxlength);
form.lang.value=(maxlength-dlina);}
required = new Array("mailto", "mailfrom", "subject", "message");
required_show = new Array("Кому", "От кого", "Тема", "Сообщение");
function SendForm () {
var i, j;
for(j=0; j<required.length; j++) {
for (i=0; i<document.forms[0].length; i++) {
if (document.forms[0].elements[i].name == required[j] && document.forms[0].elements[i].value == "" ) {
alert('Вы не заполнили форму "' + required_show[j] + '"');
document.forms[0].elements[i].focus();
return false;
}
}
}
return true;
}
</script>
<table width="40%" align="center" border="0" cellspacing="5" cellpadding="0">
<tr>
<td height="20" align="center" style="background-color: #25496D;">
<b>Z-Mailer 1.0</b>
<tr>
<td height="120" align="center">
<form name="sender" method="post" action="<?php echo $PHP_SELF; ?>?send" onsubmit="return SendForm();">
Кому<BR><input type="text" name="mailto" size="50"><BR>
От кого<BR><input type="text" name="mailfrom" size="50"><BR>
Тема<BR><input type="text" name="subject" size="50"><BR><BR>
<tr><td height="30" align="center">
Кодировка <select name="select_charset">
<option value="win">Win</option>
<option value="koi"> Koi</option>
<option value="iso"> Iso</option>
<option value="dos"> Dos</option>
<option value="mac"> Mac</option>
<select>
Доступно <input type="text" name="lang" size="2" value="1000"> символов<BR>
<tr><td height="200" align="center" valign="bottom">
<textarea name="message" rows="10" cols="70" onChange="maxlength_lang(document.sender)" onKeyUp="maxlength_lang(document.sender)" onKeyDown="maxlength_lang(document.sender)" onClick="maxlength_lang(document.sender)" onKeyPress="maxlength_lang(document.sender)"></textarea><BR><BR><BR>
<input type="submit" name="submit" style="width: 90pt; cursor: hand;" value="Отправить"> <input type="reset" name="reset" style="width: 90pt; cursor: hand;" value="Очистить">
</form></table>
<?php
if ($QUERY_STRING=="send"):
global $mailto, $subject, $message, $mailfrom, $select_charset, $charset;
switch ($select_charset){
case "win" : $charset="windows-1251";
break;
case "koi" : $charset="koi8-r";
break;
case "iso" : $charset="iso8859-5";
break;
case "dos" : $charset="x-cp866";
break;
case "mac" : $charset="x-mac-cyrillic";
break;
}
$headers = "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=$charset\r\n";
$headers .= "Date: ".date("m.d.Y (H:i:s)",time())."\r\n";
$headers .= "From: $mailfrom\r\n";
$headers .= "X-Mailer: Z-Mailer 1.0\r\n";
if (mail($mailto,$subject,$message,"$headers")) {
print ("<script language='JavaScript'> alert(\"Письмо отправлено!\"); </script>");
}else{
print ("<script language='JavaScript'> alert(\"Ошибка: Письмо не может быть отправлено!\"); </script>");
}
endif;
?>
</body>
</html>