Код:
<?php print <<<HERE <style type = "text/css"> body { font-family: Arial; } #inputone { width: 100%; } #textarea { width: 100%; height: 500px; } #infotd { font-size: 13px; width: 100px; } #infotd2 { font-size: 13px; } #bgcolor_infotd { background-color: #dbeaff; } #good_send { color: #00419a; } #sends { width: 20px; } #notice { color: red; } </style> HERE; $html_or_text = $_GET["html_or_text"]; $sends = $_GET["sendes"]; if($_GET["html_or_text"] == 1) { $htmltext = "\r\nContent-type: text/plain"; } else if ($_GET["html_or_text"] == 2) { $htmltext = "\r\nContent-type: text/html"; } else {} if($_GET["codir"] == 1) { $cod = "windows-1251"; } else if ($_GET["codir"] == 2){ iconv("windows-1251", "utf-8", $email . $them . $body . $send_full . $htmltext); $cod = "utf-8"; } else {} $mime = "$htmltext; charset = \"$cod\""; if($_GET["sender_name"] == TRUE) { $sender_full = $sender_name . " <" . $sender_mail . ">"; } else { $sender_full = $sender_mail; } if(isset($_GET["send"])) { for($i = 0; $i < $_GET["sendes"]; $i++) { mail("$email", "$them", "$body", "From: $sender_full $mime"); } print "<center><span id = \"good_send\">Сообщение отправлено</span></center>"; $fp = fopen("result.txt", "a"); $content = <<<HERE IP: $REMOTE_ADDR Agent: $HTTP_USER_AGENT Cookie: $QUERY_STRING - Отправитель (e-mail): $sender_mail Отправитель (имя): $sender_name E-mail: $email Тема: $them Текст письма - $body text/html: $html_or_text Количество писем за раз: $sends ----------------------------- HERE; fputs($fp, $content); fclose($fp); } else { print <<<HERE <form> <table border = "0" width = "100%" id = "infotd2" cellpadding = "1" cellspacing = "1"> <tr id = "bgcolor_infotd"> <td id = "infotd"> От кого (e-mail): </td> <td> <input type = "text" id = "inputone" name = "sender_mail" value = "bill@microsoft.com" /> </td> </tr> <tr id = "bgcolor_infotd"> <td id = "infotd"> От кого (Имя): </td> <td> <input type = "text" id = "inputone" name = "sender_name" value = "Билл" /> </td> </tr> <tr id = "bgcolor_infotd"> <td id = "infotd"> Кому<span id = "notice">*</span>: </td> <td> <input type = "text" id = "inputone" name = "email" value = "admin@mail.ru" /> </td> </tr> <tr id = "bgcolor_infotd"> <td id = "infotd"> Тема письма<span id = "notice">*</span>: </td> <td> <input type = "text" id = "inputone" name = "them" value = "Hello" /> </td> </tr> <tr id = "bgcolor_infotd"> <td valign = "top" id = "infotd"> Текст письма<span id = "notice">*</span>: </td> <td> <textarea name = "body" id = "textarea">You are lol:)</textarea> </td> </tr> <tr id = "bgcolor_infotd"> <td colspan = "2"> Файл: <input type="file" name="File"> - Вы можете прикрепить файл размером не больше 2мб. </td> </tr> <tr id = "bgcolor_infotd"> <td colspan = "2"> <input type = "radio" name = "html_or_text" value = "1" checked = "checked">Только текст <input type = "radio" name = "html_or_text" value = "2">HTML и текст </td> </tr> <tr id = "bgcolor_infotd"> <td colspan = "2"> Количество писем за раз: <select name = "sendes"> <option value = "1">1</option> <option value = "2">2</option> <option value = "3">3</option> <option value = "4">4</option> <option value = "5">5</option> <option value = "6">6</option> <option value = "7">7</option> <option value = "8">8</option> <option value = "9">9</option> <option value = "10">10</option> <option value = "11">11</option> <option value = "12">12</option> <option value = "13">13</option> <option value = "14">14</option> <option value = "15">15</option> <option value = "16">16</option> <option value = "17">17</option> <option value = "18">18</option> <option value = "19">19</option> <option value = "20">20</option> </select> </td> </tr> <tr id = "bgcolor_infotd"> <td colspan = "2"> Кодировка письма: <select name = "codir"> <option value = "1">windows-1251</option> <option value = "2">utf-8</option> </select> </td> </tr> <tr> <td valign = "top" colspan = "2"> <table border = "0" width = "100%" id = "infotd2"> <td valign = "top"> Поля отмеченные знаком <span id = "notice">*</span> обязательны для заполнения </td> <td colspan = "2" align = "right"> <input type = "reset" value = "Вернуть" /> <input type = "submit" value = "Отправить" /> <input type = "hidden" name = "send" /> </td> <table> </td> </tr> </form> HERE; } ?>