CodeIgniterバージョン2.2.1を使用してメールを送信しています。しかし、それは私にエラーを与えています。これが私のPHPコードです:
$config = array(
'protocol'=>'smtp',
'smtp_host'=>'ssl://smtp.googlemail.com',
'smtp_port'=>465,
'smtp_user'=>'[email protected]',
'smtp_pass'=>'xxx'
);
$this->load->library('email',$config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]', "My Name");
$this->email->to($to);
$this->email->subject($subject);
$this->email->message($message);
$this->email->send();
return $this->email->print_debugger();
しかし、私が送るとき、それは私にこのエラーを与えています。私は多くの方法を試しました。なんでこんなことが起こっているの?
220 smtp.gmail.com ESMTP ci2sm13227458pbc.66 - gsmtp
hello: 250-smtp.gmail.com at your service, [61.4.76.240]
250-SIZE 35882577
250-8BITMIME
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-PIPELINING
250-CHUNKING
250 SMTPUTF8
Failed to send AUTH LOGIN command. Error: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
from: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
The following SMTP error was encountered: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
to: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
The following SMTP error was encountered: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
data: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
The following SMTP error was encountered: 530 5.7.0 Must issue a STARTTLS command first. ci2sm13227458pbc.66 - gsmtp
502 5.5.1 Unrecognized command. ci2sm13227458pbc.66 - gsmtp
The following SMTP error was encountered: 502 5.5.1 Unrecognized command. ci2sm13227458pbc.66 - gsmtp
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.
User-Agent: CodeIgniter
Date: Thu, 15 Oct 2015 08:45:28 +0200
From: "War" <[email protected]>
Return-Path: <[email protected]>
To: [email protected]
Subject: =?utf-8?Q?subject?=
Reply-To: "[email protected]" <[email protected]>
X-Sender: [email protected]
X-Mailer: CodeIgniter
X-Priority: 3 (Normal)
Message-ID: <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
Every find bro ? I am here for u .
xamppでlocalhostを使用しています。ローカルホストで何かを構成する必要がありますか?
助けてくれてありがとう。ついに答えが出ました。問題はグーグルからでした。安全性の低いアプリをブロックしています。だから私はグーグルにサインインして安全性の低いアプリへのアクセスをオンにした後、このURLhttps ://www.google.com/settings/security/lesssecureappsに移動しました。詳細については、こちらをご覧ください。
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加