【问题标题】:Send mail function of CodeIgniter works on localhost but does not work on live serverCodeIgniter 的发送邮件功能在本地主机上有效,但在实时服务器上无效
【发布时间】:2019-08-03 19:40:36
【问题描述】:

CodeIgniter 的发送邮件功能在本地主机上工作,但在实时服务器上不工作。我该怎么办? 我正在使用gmail smtp,以下是详细信息。

class CI_Email {    
    public $useragent   = 'CodeIgniter';
    public $mailpath    = '/usr/sbin/sendmail'; // Sendmail path
    public $protocol    = 'ssmtp';      // mail/sendmail/smtp
    public $smtp_host   = 'ssmtp.gmail.com';
    public $smtp_user   = 'xxxx@gmail.com';
    public $smtp_pass   = 'xxxxx';
    public $smtp_port   = '465';
    public $smtp_timeout = 50;
    public $smtp_keepalive  = FALSE;
    public $smtp_crypto = 'ssl';
    public $wordwrap    = TRUE;
    public $wrapchars   = 76;
    public $mailtype    = 'html';
    public $charset    = 'UTF-8';
    public $alt_message = '';
    public $validate   = FALSE;
    public $priority   = 3; // Default priority (1 - 5)
    public $newline    = "\n";  // Default newline. "\r\n" or "\n" (Use "\r\n" to comply with RFC 822)
    public $crlf        = "\n";
    public $dsn     = FALSE;
    public $send_multipart  = TRUE;
    public $bcc_batch_mode  = FALSE;
    public $bcc_batch_size  = 200;
    protected $_safe_mode   = FALSE;
    protected $_subject    = '';
    protected $_body        = '';
    protected $_finalbody   = '';
    protected $_header_str  = '';
    protected $_smtp_connect = '';
    protected $_encoding    = '8bit';
    protected $_smtp_auth   = true;
    protected $_replyto_flag = FALSE;
    protected $_debug_msg   = array();
    protected $_recipients  = array();
    protected $_cc_array    = array();
    protected $_bcc_array   = array();
    protected $_headers    = array();
    protected $_attachments = array();
    protected $_protocols   = array('mail', 'sendmail', 'smtp');
    protected $_base_charsets = array('us-ascii', 'iso-2022-');
    protected $_bit_depths  = array('7bit', '8bit');
    protected $_priorities = array(
        1 => '1 (Highest)',
        2 => '2 (High)',
        3 => '3 (Normal)',
        4 => '4 (Low)',
        5 => '5 (Lowest)'
    );
}

我错过了什么或我做错了什么?请,建议。提前致谢

【问题讨论】:

    标签: codeigniter email smtp


    【解决方案1】:

    您的扩展extension=php_openssl.dll 是否在服务器上的php.ini 中启用?如果不是,请删除 ; 并再次查看。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-03-26
      • 1970-01-01
      • 2011-04-06
      • 1970-01-01
      • 2014-06-30
      • 2020-11-04
      • 2017-03-26
      • 1970-01-01
      相关资源
      最近更新 更多