2010-06-18 55 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

相关问题