Codeigniter 3:电子邮件不通过第三方发送
Codeigniter 3: Email not sending via third party
我的网站托管在 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('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
通过使用此代码,您可以检查邮件功能。您也可以关注 codeigniter 邮件 class
Codeigniter email class
试试这个
首先,加载库
$this->load->library('email');
$this->email->from('test@abc.com', 'Sender Name');
$this->email->to('to@gmail.com');
$this->email->subject('Sample');
$this->email->message('Email testing');
使用条件检查邮件是否发送
if($this->email->send()){
echo 'Scuuess';
}else{
echo 'Fail';
}
我的网站托管在 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('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
通过使用此代码,您可以检查邮件功能。您也可以关注 codeigniter 邮件 class Codeigniter email class
试试这个 首先,加载库
$this->load->library('email');
$this->email->from('test@abc.com', 'Sender Name');
$this->email->to('to@gmail.com');
$this->email->subject('Sample');
$this->email->message('Email testing');
使用条件检查邮件是否发送
if($this->email->send()){
echo 'Scuuess';
}else{
echo 'Fail';
}