2010-06-18 60 views
0

我試圖通過本地主機(XAMPP Windows 1.7.3安裝)發送電子郵件,但我一直在嘗試幾個小時沒有成功。在本地XAMPP服務器上發送帶CodeIgniter的電子郵件

這是最後的代碼,我想:

$config = Array(
     'protocol' => 'smtp', 
     'smtp_host' => 'ssl://smtp.gmail.com', 
     'smtp_port' => 465, 
     'smtp_user' => '[email protected]', 
     'smtp_pass' => 'mypassword', 
    ); 


    $this->load->library('email', $config); 
    $this->email->set_newline("\r\n"); 

    $this->email->from('[email protected]', 'My Name'); 
    $this->email->to('[email protected]'); 


    $this->email->subject('Email Test'); 
    $this->email->message('Testing the email class.'); 

    if($this->email->send()) 
    { 
    echo 'Your email was sent.'; 
    } 
    else 
    { 
    show_error($this->email->print_debugger()); 
    } 

每當我試圖加載該頁面顯示,它的加載,但沒有任何反應。我需要在我的服務器上設置什麼來確保電子郵件傳送?

我搞砸了php.ini和sendmail的配置有點沒有運氣。而且openSSL在重要的情況下不可用。

任何想法有什麼不對?

回答

0

確保已在您的php.ini(安裝的apache/bin /文件夾中的一個)中啓用了php_openssl.dll和php_smtp.dll。

爲什麼isnt opensll availabile?

+0

真的不知道。我試圖手動添加行來加載它們,但它給我一個錯誤,它無法找到庫。我下載了OpenSSL,但我不知道如何將它安裝在我的XAMPP安裝中。有任何想法嗎? – KeyStroke 2010-06-18 11:21:55

+0

您是否在重新加載配置後重新啓動apache? 並確保libeay32.dll和ssleay32.dll在Apache/bin? – DRL 2010-06-18 11:28:47

+0

好吧,它似乎現在可以工作(添加SSL)。但仍然試圖用上面的代碼發送電子郵件沒有迴應。該網頁看起來像是永遠加載。 – KeyStroke 2010-06-18 12:45:58

相關問題