現在、私は自分のメールフォーマットをテストしていて、localhostでメールを送ります。私はXAMPPを使用し、Mercuryメールサーバを設定しています。私は何も変えずに新しいユーザーを作った。PHPMailer SMTPエラー:Mercury localhostを認証できませんでした
$mailer = new mailer\Mailer();
$mailer->setCustomSettings();
// Some addAddress, From, subject and content variables are set here....
$mailer->send();
そしてsetCustomSettings
見て:私はPHP(すべてではないコードが、重要な部分)でこれを持って、そして、
:ここ
は、ローカルユーザのPICですこのように:public function setCustomSettings() {
$this->CharSet = 'UTF-8';
$this->isSMTP();
$this->Host = 'localhost';
$this->SMTPAuth = true;
$this->Username = 'Admin';
$this->Password = '*******';
//$this->SMTPSecure = 'tls';
$this->Port = 25;
$this->imapHost = '127.0.0.1';
}
今、私はそれがうまくいくと思った残念ながらそれはしません。
私のパスワードが正しいことを知っていますが、ユーザーが存在し、メールでRoundcubeにログインできることがわかります。
2017-03-27 07:57:18 SERVER -> CLIENT: 220 localhost ESMTP server ready.
2017-03-27 07:57:18 CLIENT -> SERVER: EHLO SOMENAME.local
2017-03-27 07:57:18 SERVER -> CLIENT: 250-localhost Hello SOMENAME.local; ESMTPs are:
250-TIME
250-SIZE 0
250 HELP
2017-03-27 07:57:18 CLIENT -> SERVER: QUIT
2017-03-27 07:57:18 SERVER -> CLIENT: 221 localhost Service closing channel.
2017-03-27 07:57:18 SMTP Error: Could not authenticate.
'$ this-> SMTPDebug = 2;' –
を使用してデバッガを有効にしようとしました。 –
'Username =" root @ localhost "を指定しようとしました。 –