我的网站托管在 infinityfree 中,我尝试发送电子邮件,但没有收到任何电子邮件。这是我使用的代码
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'xxx',
'smtp_pass' => 'xxx',
'mailtype' => 'html',
'charset' => 'iso-8859-1'
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
// Set to, from, message, etc.
$result = $this->email->send();
我是否必须在 google 或我网站的控制面板中进行设置?谢谢你
这是在 codeigniter 中发送电子邮件的最简单方法
$this->load->library('email');
$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$this->email->cc('[email protected]');
$this->email->bcc('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
通过使用此代码,您可以检查邮件功能。也可以关注codeigniter邮件类Codeigniter邮件类
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句