session_start();
if ($user <> "") {
$_SESSION['username'] = $user;
}
$username = $_SESSION['username'];
$page = $_SERVER[ 'SCRIPT_NAME' ] ;
$page = explode("/", $page);
$kat = $page[2];
$page = $page[3];
include("../includes/_config-mm.php");
mysql_connect($db_host,$db_login_vvw,$db_pass_vvw);
$select = mysql_db_query($db_name_vvw,"select * from rr_bills where bill_id = '$bill_id'");
$row = mysql_fetch_array($select);
if($action == "Senden") {
require 'PHPMailerAutoload.php';
// require '/home/rostrdbn/PHPMailer/vendor/autoload.php';
$pdfurl = "/home/rostrdbn/admin.rostroth.de/rechnungen/RE".$row[bill_id].".pdf";
$pdf_name = "RE".$row[bill_id].".pdf";
date_default_timezone_set('Etc/UTC');
$cnee_message = nl2br($mailtext);
$cnee_message_text_plain = str_replace("
", "", $mailtext);
$cnee = $email;
$mail = new PHPMailer;
$mail->isSMTP();
$mail->SMTPOptions = array(
'ssl' => array(
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
)
);
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 0;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
$mail->SMTPAuth = true;
$mail->SMTPSecure = 'ssl';
$mail->Host = "www.supportserver.de";
$mail->Port = 465;
$mail->Username = "officera";
$mail->Password = "xAkma/8hgf";
$mail->setFrom('office@rostroth.de', 'RostRoth GbR');
$mail->addAddress($cnee, '');
$mail->AddBCC('office@rostroth.de','');
$mail->Subject = $betreff;
$mail->msgHTML($cnee_message);
//Replace the plain text body with one created manually
$mail->AltBody = $cnee_message_text_plain;
//Attach an image file
$mail->AddAttachment($pdfurl, $name = $pdf_name, $encoding = 'base64', $type = 'application/pdf');
//send the message, check for errors
if (!$mail->send()) {
echo "Mailer Error: " . $mail->ErrorInfo . "
";
} else {
echo "Message sent!
";
}
}
?>