![](/img/trans.png)
[英]Codeigniter: Your server might not be configured to send mail using this method. Unable to send email using PHP SMTP
[英]I would like to send email using SMTP server with codeigniter
我正在尝试使用带有 codeIgniter 的 SMTP 服务器发送电子邮件
我有代码并且它在本地主机上运行良好,但在服务器上运行良好,我进行了大量研究并尝试了许多代码,但它仍然无法正常工作。
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxxxx@gmail.com',
'smtp_pass' => 'xxxxxxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from('xxx@gmail.com', 'Blabla');
$list = array('xxx@gmail.com','xxxxx@gmail.com');
$this->email->to($list);
$this->email->reply_to('xxxxx@gmail.com', 'Explendid Videos');
$this->email->subject('This is an email test');
$this->email->message('It is working. Great!');
$result = $this->email->send();
错误-
遇到以下 SMTP 错误:111 连接被拒绝 无法使用 PHP SMTP 发送电子邮件。 您的服务器可能未配置为使用此方法发送邮件。
请编辑您的自动加载到
$autoload['libraries'] = array('database','email');
如果您仍然收到错误,请告知...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.