codeigniter localhost电子邮件不发送 [英] codeigniter localhost email not sending

查看:188
本文介绍了codeigniter localhost电子邮件不发送的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些问题,我不明白..
这是我的代码

i have some problem and i don't understand.. this is my code

    $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('rudzstyle@yahoo.co.id', 'Your Name');
    $this->email->to('rudzstyle@gmail.com');
    $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个电子邮件都是有效的电子邮件..

that 2 email are active email..

,调试器的结果为


退出状态代码:1无法打开Sendmail的套接字。请检查
设置。无法使用PHP Sendmail发送电子邮件。您的服务器可能
未配置为使用此方法发送邮件。

Exit status code: 1 Unable to open a socket to Sendmail. Please check settings. Unable to send email using PHP Sendmail. Your server might not be configured to send mail using this method.

用户代理:CodeIgniter日期:Mon,2 Jun 2014 07:53:21 + 0200 From:
Your Name返回路径:To:rudzstyle@gmail.com主题:
=?iso-8859-1?Q?Riyanto test?=
=?iso- 8859-1?Q ?? = Reply-To:rudzstyle@yahoo.co.idX-Sender:rudzstyle@yahoo.co.id X-Mailer:CodeIgniter X-Priority:3
-ID:< 538c1151179cb@yahoo.co.id> Mime-Version:1.0

User-Agent: CodeIgniter Date: Mon, 2 Jun 2014 07:53:21 +0200 From: "Your Name" Return-Path: To: rudzstyle@gmail.com Subject: =?iso-8859-1?Q?Riyanto test?= =?iso-8859-1?Q??= Reply-To: "rudzstyle@yahoo.co.id" X-Sender: rudzstyle@yahoo.co.id X-Mailer: CodeIgniter X-Priority: 3 (Normal) Message-ID: <538c1151179cb@yahoo.co.id> Mime-Version: 1.0

Content-Type:text / plain; charset = iso-8859-1
Content-Transfer-Encoding:8bit

Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit

测试电子邮件类。


推荐答案

In Codeigniter,Try this

            $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('no-reply@your-site.com', 'Site name');
            $this->email->to('to-address-mail-id');
            $this->email->subject('Notification Mail');
            $this->email->message('Your message');
            $this->email->send();

$ config ['smtp_user'] 字段,请输入您的email_id并在 $ config ['smtp_pass'] 字段中输入您的密码。

In $config['smtp_user'] field,give your email_id and in $config['smtp_pass'] field,provide your password for that mail..

这将工作。
希望这将解决你的问题..

This will work.Just try it. Hope this will solve your problem..

这篇关于codeigniter localhost电子邮件不发送的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆