我在主機Cpanel中使用Codeignter。在本地我可以通過谷歌帳戶發送電子郵件,但在主機Cpanel它錯誤。 這是我的配置:Codeigniter發送谷歌郵件錯誤
$ci = get_instance();
$ci->load->library('email');
$config['protocol'] = "smtp";
$config['smtp_host'] = "ssl://smtp.gmail.com";
$config['smtp_port'] = 465;
$config['smtp_user'] = "[email protected]";
$config['smtp_pass'] = "xxx";
$config['charset'] = "utf-8";
$config['mailtype'] = "html";
$config['newline'] = "\r\n";
$ci->email->initialize($config);
Openssl在主機上啓用。
這是錯誤警報:
.....
Message: fsockopen() ...: unable to connect to ssl://smtp.gmail.com:465
.....
請幫幫我! 對不起我的英語不好
'ci =&get_instance' –