-2
**Error:**SMTP NOTICE: EOF caught while checking if connected SMTP connect() failed.
Mailer Error: SMTP connect() failed.
我的代碼是:我要發使用PHPMailer的電子郵件給錯誤
<?php
require('class.phpmailer.php');
//require_once('class.phpmailer.php');
//require_once("inc/phpmailer/class.phpmailer.php");
$mail = new PHPMailer();// create a new object
$mail ->IsSMTP(); // enable SMTP
$mail ->SMTPDebug = 1; // debugging: 1 = errors and messages, 2 = messages only
$mail->SMTPAuth = true; // authentication enabled
$mail->SMTPSecure = 'ssl'; // secure transfer enabled REQUIRED for GMail
$mail->Host = "smtp.gmail.com";
$mail->Port = 587; // or 465
$mail->IsHTML(true);
$mail->Username = "[email protected]";
$mail->Password = "mudunuru%^&";
$mail->SetFrom("[email protected]");
$mail->Subject = "Test";
$mail->Body = "hello";
$mail->AddAddress("[email protected]");
print $mail;
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been sent";
}
你的幫助將apperaciated