我想通過使用下面的CodeIgniter代碼將電子郵件從wampserver「localhost」發送到我的gmail帳戶。從本地發送電子郵件中的問題[WAMP]在CI
public function emailsent_info()
{
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]',
'smtp_pass' => 'XXXXXXX',
);
$this->load->library('email',$config);
//$this->email->set_newline("\r\n");
$this->email->from('[email protected]', 'Deepak Saar');
$this->email->to('[email protected]');
$this->email->subject('Matters Mostly Good');
$this->email->message('Its Working Now, Great');
if($this->email->send())
{
echo 'Your Email Sent Successfully';
}
else
{
echo $this->email->print_debugger();
}
} 我沒有做在CI的任何其他文件的任何其他修改呢。當我運行該項目時,服務器回答如下: 我在哪裏出錯?
的LocalServer無法發送郵件兄弟 – Exprator
@Exprator,有一些參考,我通過網絡看到發送電子郵件通過ci – Keynes
你不能從本地服務器兄弟。 – Exprator