3

このエラーが発生し続けます..

以下は私のコードです:

<?php
ini_set("include_path", "phpmailer/"); 
require 'phpmailer/class.phpmailer.php';
$mailer = new PHPMailer();
$mailer->IsSMTP();
$mailer->Host = 'smtp.gmail.com';
$mailer->Port='465';
$mailer->SMTPAuth = TRUE;
$mailer->Username = 'mail@gmail.com';  // Change this to your gmail adress
$mailer->Password = '****';  // Change this to your gmail password
$mailer->From = 'maile@gmail.com';  // This HAVE TO be your gmail adress
$mailer->FromName = 'Belmer'; // This is the from name in the email, you can put anything you like here
$mailer->Body = 'This is the main body of the email';
$mailer->Subject = 'This is the subject of the email';
$mailer->AddAddress('another@ymail.com');  // This is where you put the email adress of the person you want to mail
if(!$mailer->Send())
{
   echo "Message was not sent<br/ >";
   echo "Mailer Error: " . $mailer->ErrorInfo;
}
else
{
   echo "Message has been sent";
}
?>

誰でもこのエラーを知っていますか?ご返信いただきありがとうございます。

4

1 に答える 1

0

とった!ご覧いただきありがとうございます。

実際にはコードに問題はありません。ローカル サーバーで何らかの設定を行う必要があります。私の解決策は、ファイルをライブ Web サーバーにアップロードしたことであり、すべて正常に動作しています。

于 2010-09-01T12:42:21.567 に答える