2012-05-26 30 views
0

我試圖使用CI電子郵件類來發送電子郵件,但頁面只是在它嘗試發送時掛起。我已經嘗試過兩種IIS,現在在我的Mac上使用MAMP。代碼與已被複制到的地方相同,似乎適用於其他人!MAMP/IIS上的CodeIgniter/Gmail SMTP超時

$config = Array(
       'protocol' => 'smtp', 
       'smtp_host' => 'ssl://smtp.googlemail.com', 
       'smtp_port' => '465', 
       'smtp_user' => 'xxx', 
       'smtp_pass' => 'xxx', 
       'mailtype' => 'html', 
       'starttls' => true 
      ); 

     $this->load->library('email', config); 
     $this->email->from('[email protected]', 'George'); 
     $this->email->to('[email protected]'); 
     $this->email->subject('hey this is an email'); 
     $this->email->message('this is the content of the email'); 
     $this->email->send(); 

任何其他服務器設置嘗試?

回答

1

好了,所以我很不好意思地說,我是缺少$在:

$this->load->library('email', config); 

這是浪費想盡端口/服務器/防火牆/安全設置想象一整天。

我希望這可以幫助像我這樣愚蠢的人。