Bom dia galera, estou terminando um site, porém no formulário de contato que estou utilizando o PHP mail, após enviar o e-mail ele mostra todo o log do envio ao invés de mostrar apenas a mensagem de enviado com sucesso, value pela ajuda!
<?php
date_default_timezone_set('Etc/UTC');
require 'PHPMailerAutoload.php';
$erros = "";
//Create a new PHPMailer instance
$mail = new PHPMailer;
//Tell PHPMailer to use SMTP
$mail->isSMTP();
//Enable SMTP debugging
// 0 = off (for production use)
// 1 = client messages
// 2 = client and server messages
$mail->SMTPDebug = 2;
//Ask for HTML-friendly debug output
$mail->Debugoutput = 'html';
//Set the hostname of the mail server
$mail->Host = 'smtp.dualtec.com.br';
// use
// $mail->Host = gethostbyname('smtp.gmail.com');
// if your network does not support SMTP over IPv6
//Set the SMTP port number - 587 for authenticated TLS, a.k.a. RFC4409 SMTP submission
$mail->Port = 587;
//Set the encryption system to use - ssl (deprecated) or tls
$mail->SMTPSecure = 'tls';
//Whether to use SMTP authentication
$mail->SMTPAuth = true;
//Username to use for SMTP authentication - use full email address for gmail
$mail->Username = 'usuario';
//Password to use for SMTP authentication
$mail->Password = 'senha';
//Set who the message is to be sent from
$mail->setFrom('remetente','CONTATO DO SITE');
//Set an alternative reply-to address
//$mail->addReplyTo('replyto@example.com', 'First Last');
//Set who the message is to be sent to
$mail->addAddress('destinatario');
//Set the subject line
$mail->Subject = $_POST['assunto'];
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML(file_get_contents('contents.html'), dirname(__FILE__));
//Replace the plain text body with one created manually
$mail->Body .= '<div style="margin:0 auto;padding:0;width:500px;">';
$mail->Body .= '<h1 style="float:left;color:#000;padding:8px 40px;">Contato pelo site</h1>';
$mail->Body .= '</div>';
$mail->Body .= '<div style="clear:both;background:#f7f7f7;border-radius:10px;box-shadow:-2px 2px 2px #B6B6B6 , -2px -2px 2px #B6B6B6 ,-2px 2px 2px #B6B6B6 ,2px -2px 2px #B6B6B6;">';
$mail->Body .= '<h2 style="padding:15px; font-size:16px; color:#07335F; background-color:#FFCE4A; -webkit-border-top-left-radius: 10px; -webkit-border-top-right-radius: 10px; -moz-border-radius-topleft: 10px; -moz-border-radius-topright: 10px;border-top-left-radius: 10px; border-top-right-radius: 10px;">Dados do formulario de contato</h2>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Nome:</strong>' .$_POST['nome'] .'</h3>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>E-mail:</strong>' .$_POST['mail'] .'</h3>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Telefone:</strong>' .$_POST['fone'] .'</h3>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Empresa:</strong>' .$_POST['empresa'] .'</h3>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Assunto:</strong>' .$_POST['assunto'] . '</h3>';
$mail->Body .= '<h3 style="padding:5px 15px; font-size:16px;"><strong style="color:#07335F";font-weight:bold;>Mensagem:</h3>';
$mail->Body .= '<p style="text-align:justify;padding:5px 15px;color:#000;">';
$mail->Body .= $_POST['mensagem'] .'</p>';
$mail->Body .= '</div>';
$mail->Body .= '</div>';
////$mail->Body = $_POST['mensagem'];
//$mail->AltBody = $_POST['texto'];
//Attach an image file
//$mail->addAttachment('images/phpmailer_mini.png');
//send the message, check for errors
$send = $mail->Send();
if($send){
echo '<div>';
echo '<p><h1>Sua Mensagem foi enviada com sucesso.</h1></p>';
echo '</div>';
}else{
echo '<div>';
echo '<p><h1>Não foi possível enviar a mensagem.<ha/h1>';
echo '</div>';
}
?>