我有一些问题,我不明白。
这是我的代码
$this->load->library('email');
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;
$this->email->initialize($config);
$this->email->from('[email protected]', 'Your Name');
$this->email->to('[email protected]');
$message = $data->nama_depan.'<br>'.$this->input->post('snk');
$this->email->subject($message);
$this->email->message('Testing the email class.');
$this->email->send();
echo $this->email->print_debugger();
这 2 封电子邮件是活跃电子邮件。
调试器的结果是这样的
退出状态代码:1 无法打开 Sendmail 的套接字。请检查
设置。无法使用 PHP Sendmail 发送电子邮件。你的服务器可能
未配置为使用此方法发送邮件。
用户代理:CodeIgniter 日期:2014 年 6 月 2 日星期一 07:53:21 +0200 来自:
“你的名字”返回路径: 至:[电子邮件受保护]主题:
=?iso-8859-1?Q?Riyanto 测试?=
=?iso-8859-1?Q??= 回复:“[电子邮件受保护]“ X 发送者:[电子邮件受保护]X-Mailer:CodeIgniter X-优先级:3
(正常)消息 ID:[电子邮件受保护]> Mime 版本:1.0
内容类型:文本/纯文本;字符集=iso-8859-1
内容传输编码:8 位
测试电子邮件类。
在 Codeigniter 中,试试这个
$this->load->library('email');
$config['protocol']='smtp';
$config['smtp_host']='your host';
$config['smtp_port']='465';
$config['smtp_timeout']='30';
$config['smtp_user']='your mail id';
$config['smtp_pass']='your password';
$config['charset']='utf-8';
$config['newline']="\r\n";
$config['wordwrap'] = TRUE;
$config['mailtype'] = 'html';
$this->email->initialize($config);
$this->email->from('[email protected]', 'Site name');
$this->email->to('to-address-mail-id');
$this->email->subject('Notification Mail');
$this->email->message('Your message');
$this->email->send();
In $config['smtp_user']
字段,输入您的 email_id 并输入$config['smtp_pass']
字段,提供该邮件的密码。
这会起作用的。试试吧。
希望这能解决您的问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)