我正在尝试使用域电子邮件ID从实时服务器发送电子邮件。每当遇到相同的错误时,我尝试使用不同的端口ID。我的控制器代码如下:
-plugin /home/myhome/Android/Sdk/ndk-bundle/toolchains/llvm/prebuilt/linux-x86_64/bin/../lib64/LLVMgold.so -plugin-opt=mcpu=generic -plugin-opt=Os -plugin-opt=-function-sections -plugin-opt=-data-sections
答案 0 :(得分:0)
$this->load->library('email');
//SMTP & mail configuration
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => 'example@gmail.com',
'smtp_pass' => 'password',
'mailtype' => 'html',
'charset' => 'utf-8'
);
$this->email->initialize($config);
$this->email->from('info@*******.com', 'Hima');
$this->email->to($email);
$this->email->subject('email verification');
$this->email->message('Verification Code');
$send = $this->email->send();
if ($send) {
$this->session->set_flashdata('msg','success');
} else {
echo $error = $this->email->print_debugger();
}
答案 1 :(得分:0)
我的配置如下:
public function send_mail() {
$this->load->library('encrypt');
$config = array(
'protocol' => 'smtp',
'smtp_host' => 'smtp.gmail.com',
'smtp_port' => '465',
'smtp_user' => '*****@gmail.com',
'smtp_pass' => '**********',
'smtp_crypto' => 'ssl',
'crlf' => "\r\n",
);
$this->load->library('email',$config);
$send = $this->email->send();
if ($send) {
return $send;
} else {
$error = show_error($this->email->print_debugger());
return $error;
}
}
希望这会有所帮助!