简体   繁体   English

CodeIgniter 3的SMPT超时错误

[英]SMPT timeout error with CodeIgniter 3

In my local environment the email works, but once I transfer to my online website, the smtp email does not work and shows timeout error. 在我的本地环境中,该电子邮件有效,但是一旦我转移到在线网站,该smtp电子邮件将不起作用,并显示超时错误。

This is my config/email.php file: 这是我的config/email.php文件:

<?php defined('BASEPATH') OR exit('No direct script access allowed.');

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.gmail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = '[email]';
$config['smtp_pass'] = '[password]';
$config['smtp_timeout'] = 30;
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;

I use Cpanel, do I need to configure something? 我使用Cpanel,是否需要进行配置?

smtp_host should change smtp_host应该更改

$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = $sender_email;
$config['smtp_pass'] = $sender_password;
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$this->load->library('email', $config);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM