【问题标题】:Unable to Send Email , Codeigniter, Network solution , SMTP无法发送电子邮件,Codeigniter,网络解决方案,SMTP
【发布时间】:2011-10-02 06:55:31
【问题描述】:

我正在将 Codeigniter 用于网络解决方案中托管的网站, 并且无法发送电子邮件 我的电子邮件配置页面是

 <?php  if ( ! defined('BASEPATH')) exit('No direct script access allowed');
        /*
        | -------------------------------------------------------------------
        | EMAIL CONFING
        | -------------------------------------------------------------------
        | Configuration of outgoing mail server.
        | */
    $config['protocol']='smtp';
    $config['smtp_host']='hostname';
    $config['smtp_port']='587';
    $config['smtp_timeout']='80';
    $config['smtp_user']='user';
    $config['smtp_pass']='password';
    $config['_smtp_auth']=TRUE;
    $config['charset']='utf-8';
    $config['newline']="\r\n";
    /* End of file email.php */
    /* Location: ./system/application/config/email.php */  

在 Outlook 中,我必须检查我的传出服务器需要对该电子邮件地址进行身份验证。 任何帮助将不胜感激。

【问题讨论】:

  • 这些数据正确吗?如果是,请发布您用于发送电子邮件的 CI 代码(可能存在错误?)
  • CodeIgniter 带有一个调试器,您可以使用它来检查发送电子邮件是否有问题。尝试在发送电子邮件的行之后添加$this-&gt;email-&gt;print_debugger(),看看会出现什么。
  • 电子邮件无法发送,出现错误,一段时间后,严重性:警告消息:fsockopen() [function.fsockopen]:无法连接到 mail.domain.com:587(连接计时out)文件名:libraries/Email.php 行号:1652 @Damien Pirsy,发送电子邮件的 CI 代码运行良好,这些数据与我在 Outlook 中配置的完全相同,因为我必须检查传出服务器需要身份验证( link),我认为问题在于 _smtp_auth
  • 另外,它在本地主机中使用相同的配置工作正常,但问题是它在网络解决方案服务器中。

标签: php email codeigniter smtp


【解决方案1】:

好吧,我明白了,我必须在服务器上的 email.php 中将 localhost 作为主机名,然后它就起作用了。 (也许它也会帮助其他人......)

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-12-16
    • 2018-12-08
    • 2015-11-10
    • 2016-11-15
    • 2022-07-20
    • 1970-01-01
    • 2012-12-05
    相关资源
    最近更新 更多