0

PHPMailer 用の php プラグインを使用しています。そのバージョンは PHPMailer_5.2.4 です。PhpMailer サイトのサンプル コードをテストしました。

 <?php
require_once('PHPMailer_5.2.4/class.phpmailer.php');
//include("class.smtp.php"); // optional, gets called from within class.phpmailer.php if not already loaded

$mail             = new PHPMailer();

//$body             = file_get_contents('contents.html');
//$body             = eregi_replace("[\]",'',$body);

$mail->IsSMTP(); // telling the class to use SMTP
$mail->Host       = "mail.google.com"; // SMTP server
$mail->SMTPDebug  = 2;                     // enables SMTP debug information (for testing)
                                           // 1 = errors and messages
                                           // 2 = messages only
$mail->SMTPAuth   = true;                  // enable SMTP authentication
$mail->SMTPSecure = "tls";                 // sets the prefix to the servier
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 587;                   // set the SMTP port for the GMAIL server
$mail->Username   = "myuser@gmail.com";  // GMAIL username
$mail->Password   = "mypass";            // GMAIL password

$mail->SetFrom('myuser@gmail.com', 'First Last');

$mail->Subject    = "FeedBack";

$mail->MsgHTML("helo hru ");

$address = "whomto@domainname.com";
$mail->AddAddress($address, "MYName");
$mail->Send();


//if(!$mail->Send()) {
  ////echo "Mailer Error: " . $mail->ErrorInfo;
//} 
//else {
  //echo "Message sent!";
//}

?>

このコードを実行すると、以下の出力が得られます。しかし、メールは受信者のメールアドレスで正常に受信されました。しかし、以下の出力メッセージは必要ありません。どうすれば修正できますか?

SMTP -> サーバーから:220 mx.google.com ESMTP b3sm40861402pbu.38 - gsmtp

SMTP -> サーバーから: 250-mx.google.com [ipAddress] 250-SIZE 35882577 250-8BITMIME 250-STARTTLS 250-ENHANCEDSTATUSCODES 250 CHUNKING

SMTP -> FROM SERVER:220 2.0.0 TLS を開始する準備ができました

SMTP -> サーバーから: 250-mx.google.com [ipAddress] 250-SIZE 35882577 250-8BITMIME 250-AUTH LOGIN PLAIN XOAUTH XOAUTH2 PLAIN-CLIENTTOKEN 250-ENHANCEDSTATUSCODES 250 CHUNKING

SMTP -> サーバーから:250 2.1.0 OK b3sm40861402pbu.38 - gsmtp

SMTP -> サーバーから:250 2.1.5 OK b3sm40861402pbu.38 - gsmtp

SMTP -> FROM SERVER:354 どうぞ b3sm40861402pbu.38 - gsmtp

SMTP -> サーバーから:250 2.0.0 OK 1383737961 b3sm40861402pbu.38 - gsmtp

SMTP -> FROM SERVER:221 2.0.0 接続を閉じています b3sm40861402pbu.38 - gsmtp

4

3 に答える 3

5

次のコード行を削除するだけです。

$mail->SMTPDebug  = 2;

デバッグ出力を無効にします。

于 2013-11-06T12:00:57.697 に答える
2

これは単なるデバッグ出力です。$mail->SMTPDebug0 に設定

于 2013-11-06T12:01:16.137 に答える
1

あなたの問題は$mail->SMTPDebugラインです。

その値を設定すると、デバッグ データを出力するように PHPMailer に指示されます。

その行を削除すると、出力が得られなくなります。

于 2013-11-06T12:02:09.467 に答える