再会!
我从 Google 代码页下载了 PHPMailer 类:http ://code.google.com/a/apache-extras.org/p/phpmailer/ 。我正在运行这个:
PHP 5.2.14 (cli) (built: Jul 27 2010 10:49:36)
Copyright (c) 1997-2010 The PHP Group
Zend Engine v2.2.0, Copyright (c) 1998-2010 Zend Technologies
在 Windows 7 机器上,我正在使用以下测试代码:
require("PHPMailer_5.2.1/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Mailer = "smtp";
$mail->Host = "ssl://smtp.live.com";
$mail->Port = 587;
$mail->SMTPAuth = true;
$mail->Username = "some_email@hotmail.nl";
$mail->Password = "password";
$mail->From = "some_email@hotmail.nl";
$mail->AddAddress("some_other_email@hotmail.nl");
$mail->Subject = "Subject";
$mail->Body = "Hi!";
if(!$mail->Send()) {
echo 'Message was not sent.';
echo 'Mailer error: ' . $mail->ErrorInfo;
} else {
echo 'Message has been sent.';
我也确定密码和用户名是正确的,但我收到以下错误:
Message was not sent.Mailer error: The following From address failed: some_email@hotmail.nl
我究竟做错了什么?
提前致谢!