2016-02-02 81 views
2

我已經使用了這幾種方法,但似乎無法得到它的工作。我在實時服務器上運行它。說電子郵件發送,但沒有收到時使用Codeigniter發送電子郵件

我使用bigrock主機,並根據他們的文件說,只是使用「本地主機」作爲smtp主機。 Link

它說,電子郵件發送,但我什麼也沒得到。在提前

public function index() { 
    $config = array(
     'protocol' => 'smtp', 
     'smtp_host' => 'localhost', 
     'smtp_port' => '587', 
// Other way it say Email sent 
     //'smtp_host' => 'ssl://localhost', 
     //'smtp_port' => '465', 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => 'sdfsfsdfsd' 
    ); 
     $this->load->library('email', $config); 
     $this->email->set_newline("\r\n"); 
     $this->email->from('[email protected]', 'ABC'); 
     $this->email->to('[email protected]'); 
     $this->email->subject('Test'); 
     $this->email->message('Success'); 
    if ($this->email->send()) { 
      echo 'Email Sent'; 
     } else { 
      show_error($this->email->print_debugger()); 
     } 
} 

感謝。

回答

2

This line:$ this-> email-> to('abc @ gmail');使其'[email protected]',並確保它是現有的..如果它仍然無法正常工作,嘗試一個合理的電子郵件從你的email-> from。

+0

非常感謝..愚蠢的我.. –

+0

沒問題:)它工作? –

+0

是的,它沒有..謝謝, –