codeigniter godaddy电子邮件ssl

问题描述 投票:0回答:1

我已经厌倦了Godaddy,他们缺乏知识或解决方案,无法正常使用我的电子邮件。因此也许stackoverflow上的某个人可以解决此问题。

我无法通过安全的ssl连接使我的电子邮件在codeigniter中工作。

不安全的解决方案有效

$config['email_config'] = [
    'email_address' => '[email protected]',
    'owner'         => 'Owner',
    'email_owner'   => '[email protected]',
    'charset'       => 'utf-8',
    'mailtype'      => 'html',
    'protocol'      => 'smtp',
    'smtp_host'     => 'mail.domain.com',
    'smtp_port'     => '587', // 465, 25, 587
    'smtp_timeout'  => '7',
    'smtp_user'     => '[email protected]',
    'smtp_pass'     => 'xxx',
    'validation'    => TRUE, 
];

但是我似乎无法获得ssl连接的电子邮件。

$config['email_config'] = [
    'email_address' => '[email protected]',
    'owner'         => 'Owner',
    'email_owner'   => '[email protected]',
    'charset'       => 'utf-8',
    'mailtype'      => 'html',
    'protocol'      => 'smtp',
    'smtp_host'     => 'domain.com',
    'smtp_crypto'   => 'ssl',
    'smtp_port'     => '465', // 465, 25, 587
    'smtp_timeout'  => '7',
    'smtp_user'     => '[email protected]',
    'smtp_pass'     => 'xxx',
    'validation'    => TRUE, 
];

我的小组邮件中提供的详细信息

  • 安全的SSL / TLS设置(推荐)
  • 用户名:[email protected]
  • 密码:使用电子邮件帐户的密码。
  • 传入服务器:domain.com
  • IMAP端口:993 POP3端口:995
  • 发送服务器:domain.com
  • SMTP端口:465
  • IMAP,POP3和SMTP需要身份验证。
php email ssl codeigniter-3
1个回答
0
投票

如果您将$ config传递给codeigniter的电子邮件类,请使用类似的东西

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'host.host.com';
$config['smtp_user'] = 'username';
$config['smtp_pass'] = 'pass';
$config['smtp_crypto'] = 'tls';
$config['smtp_port'] = 587;

$config['charset'] = 'utf-8';
$config['mailtype'] = 'html';
$config['newline'] = "\r\n"; 

然后将$ config传递给方法

$this->load->library('email');
$this->email->initialize($config);

如果不起作用,则将[smtp_crypto]更改为ssl并移植到465

编辑:对于代码点火器3,代码4.0.0,其处理方式有所不同,请告诉我

© www.soinside.com 2019 - 2024. All rights reserved.