2010-06-16 8 views
4

안녕하세요 저는 PHPMailer를 마침내 Google과 함께 사용할 수있게되었지만 지금은 메시지를 보낸 후에이 출력을 화면에 표시하고 있습니다.PHPMailer가 성공적으로 보낸 전자 메일에서 에코했습니다

SMTP -> FROM SERVER:220 mx.google.com ESMTP f34sm21891943qco.35 
SMTP -> FROM SERVER: 250-mx.google.com at your service, [76.28.109.170] 250-SIZE 35651584 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH 250 ENHANCEDSTATUSCODES 
SMTP -> FROM SERVER:250 2.1.0 OK f34sm21891943qco.35 
SMTP -> FROM SERVER:250 2.1.5 OK f34sm21891943qco.35 
SMTP -> FROM SERVER:354 Go ahead f34sm21891943qco.35 
SMTP -> FROM SERVER:250 2.0.0 OK 1276700936 f34sm21891943qco.35 

사용자가 볼 수 없도록이 출력을 제거 할 수있는 방법이 있는지 궁금합니다.

답변

0

<?php 
 

 
\t require("PHPMailer/PHPMailerAutoload.php"); 
 

 
$mail = new PHPMailer; 
 

 
//Enable SMTP debugging. 3 disable=0 
 
$mail->SMTPDebug = 0;        
 

 
//Set PHPMailer to use SMTP. 
 
$mail->isSMTP();    
 

 
//Set SMTP host name       
 
$mail->Host = "smtp.gmail.com";//or your domain 
 

 
//Set this to true if SMTP host requires authentication to send email 
 
$mail->SMTPAuth = true;       
 

 
//Provide username and password  
 
$mail->Username = "your email";     
 
$mail->Password = "your email password";       
 
//If SMTP requires TLS encryption then set it 
 
$mail->SMTPSecure = "tls";       
 
//Set TCP port to connect to 
 
$mail->Port = 587;         
 

 
$mail->From = "your email"; 
 
$mail->FromName = "your name"; 
 

 
$mail->addAddress($userMail, $uname); 
 

 
$mail->isHTML(true); 
 

 
$mail->Subject = $subject; 
 
$mail->Body = $message; 
 
//$mail->AltBody = "This is the plain text version of the email content"; 
 

 
// you can also comment the echos here out 
 
if(!$mail->send()) 
 
{ 
 
    echo "Mailer Error: " . $mail->ErrorInfo; 
 
} 
 
else 
 
{ 
 
    echo "Message has been sent successfully"; 
 
} 
 

 
?>

enter code here 체크 라인 (8) 에서이 이미지는 또한 다른 {} 블록 (()! $ 메일 -> 보내기) {}는 경우에하는 주석 수 enter image description here

관련 문제