Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- define('SMTP_SERVER',''); // SMTP Server
- define('SMTP_PORT','25'); //Port
- define('SMTP_USER',''); //SMTP Username
- define('SMTP_PASS',''); //SMTP Passwort
- define('SMTP_ENCYPTION',''); //SMTP Verschlüsselung
- define('SMTP_FROM_NAME',''); //Absendername
- define('SMTP_FROM_EMAIL',''); //AbsenderEmail
- define('SMTP_FROM_TO','info@mediatpress.de'); //Empfänger Email
- use PHPMailer\PHPMailer\PHPMailer;
- use PHPMailer\PHPMailer\Exception;
- require 'vendor/autoload.php';
- $fmtResponse = file_get_contents("response.htt");
- $fmtMail = file_get_contents("mail.htt");
- $_POST['Details'] = implode("<br>",$_POST['feedback']);
- foreach($_POST['feedback'] as $key=>$value)
- {
- $_POST['feedback'][$key] = str_replace("ZU_ERSETZENDER_STRING","ERSATZ_STRING",$value);
- }
- foreach($_POST as $key=> $val) {
- if($key == "feedback") continue;
- $fmtResponse= str_replace("<$key>", nl2br($val), $fmtResponse);
- $fmtMail= str_replace("<$key>", nl2br(utf8_decode($val)), $fmtMail);
- }
- if ($_POST["access"] == "irregeheim") {
- $mail = new PHPMailer(true);
- try {
- //$mail->SMTPDebug = 2;
- $mail->isSMTP();
- $mail->Host = SMTP_SERVER;
- $mail->SMTPAuth = true;
- $mail->Username = SMTP_USER;
- $mail->Password = SMTP_PASS;
- $mail->SMTPSecure = SMTP_ENCYPTION;
- $mail->Port = SMTP_PORT;
- $mail->setFrom(SMTP_FROM_EMAIL, SMTP_FROM_NAME);
- $mail->addAddress(SMTP_FROM_TO);
- $mail->addReplyTo(SMTP_FROM_EMAIL, SMTP_FROM_NAME);
- $mail->isHTML(true);
- $mail->Subject = $_POST["subject"];
- $mail->Body = $fmtMail;
- $mail->send();
- echo $fmtResponse;
- } catch (Exception $e) {
- echo 'Message could not be sent. Mailer Error: ', $mail->ErrorInfo;
- }
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement