我使用phpmailer发送邮件,我想得到结果,因为发送邮件非常频繁。所以我想使用phpmailer“超时”。但不工作。我的代码
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Timeout = 10;
$mail->SMTPAuth = true;
$mail->SMTPKeepAlive = true;
$mail->SMTPSecure = "ssl";
$mail->Host = "smtp.gmail.com";
$mail->Port = 465;
$mail->Username = "qinqin1920@gmail.com";
$mail->Password = "xxxx";
$mail->From = "qinqin1920@gmail.com";
$mail->Subject = "This is the subject";
$mail->AltBody = "test";
//$mail->WordWrap = 50; // set word wrap
$mail->MsgHTML("test233");
//$mail->AddReplyTo("qinqin1920@gmail.com");
$mail->AddAddress("xxxx@qq.com");
$mail->IsHTML(true);
echo "<br/>".time()."<br/>";
echo "time out is ".$mail->Timeout."<br/>";
if(!$mail->Send()) {
echo "Mailer Error: " . $mail->ErrorInfo;
} else {
echo "Message has been";
}
echo "<br/>".time()."<br/>";
和 echo 是:1383181520 超时是 10 消息是 1383181534
你能帮助我吗