您好,我試了許久,均無法使用PHPMailer([url]http://phpmailer.sourceforge.net/)這個email模組,也找不出問題所在[/url]
程式碼應該是OK的,只是不知為何會有錯誤
可否幫忙瞭解一番?
錯誤訊息為下:
Mailer Error: Language string failed to load: recipients_failednickcatwang@gmail.com
<?
require("phpmailer/class.phpmailer.php");
$mail = new PHPMailer();
$mail->IsSMTP(); // ?置使用 SMTP
$mail->Host = "so-net.net.tw"; // 指定的 SMTP 服?器地址
$mail->SMTPAuth = true; // ?置?安全??方式
$mail->Username = "XXXXX"; // SMTP ??件人的用?名
$mail->Password = "XXXXX"; // SMTP 密?
$mail->From = "nickcat@so-net.net.tw";
$mail->FromName = "王文宏";
$mail->AddAddress("nickcatwang@yahoo.com.tw"); // 暱稱可不加
$mail->AddReplyTo("nickcat@so-net.net.tw", "nickcat");
$mail->WordWrap = 50; // set word wrap to 50 characters
$mail->IsHTML(true); // ?置?件格式? HTML
$mail->Subject = "試試看寄信是否成功?Here is the subject"; // ??
$mail->Body = "收到回信告訴我喔
This is the HTML message body <b>粗體字測試</b>"; // ?容
$mail->AltBody = "This is the body in plain text for non-HTML mail clients"; // 附加?容
$mail->SetLanguage("en","phpmailer/language/phpmailer.lang-en.php"); // set the default language
if(!$mail->Send())
{
echo "Message could not be sent. <p>";
echo "Mailer Error: " . $mail->ErrorInfo;
exit;
}
echo "Message has been sent
";
?>