1
請檢查我的下面的代碼,以便從我的Gmail帳戶發送電子郵件到同一個Gmail帳戶。當我運行它時,它說發送了電子郵件。但我在收件箱中找不到任何此類信息。任何人都可以提出什麼問題可以嗎?顯示'發送電子郵件',但我的收件箱中沒有任何內容。 CodeIgniter和gmail
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_password' => '****',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('[email protected]','Prajakta');
$this->email->to('[email protected]');
$this->email->subject('This is a test email');
$this->email->message('It is working. Great!! yey');
if($this->email->send())
{
echo 'Your email was sent successfully';
}
else
{
show_error($this->email->print_debugger());
}
我使用Mercury運行Xampp並設置了Mercury S SMTP服務器參數。我真的不明白爲什麼電子郵件沒有通過?有人可以幫我解決這個問題嗎?
打印調試消息(print_debugger)以查看這是否對您有所幫助。 –
@SérgioMichels我試着用print_debugger。它只是清楚地顯示一個消息 來源:「Prajakta」 返回路徑: 回覆:「[email protected]」 X-發件人:[email protected] X - 梅勒:笨 X優先: 3(Normal) Message-ID:<[email protected]> Mime-Version:1.0 Content-Type:text/plain; charset = utf-8 Content-Transfer-Encoding:8bit =?utf-8?Q?This_is_a_test_email?= 它正在工作。大!! yey – user1016310
使用SSL時,通常不會從本地主機發送郵件。嘗試從您的服務器發送。 – prograshid