codeigniter localhost email не отправляется

У меня проблемы, и я не понимаю. Это мой код

$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 сообщения электронной почты являются активными.

и результатом отладчика является

Код состояния выхода: 1 Невозможно открыть сокет для Sendmail. Проверьте настройки. Не удалось отправить электронное письмо с помощью PHP Sendmail. Возможно, ваш сервер не настроен для отправки почты с помощью этого метода.

User-Agent: CodeIgniter Дата: Пн, 2 Июн 2014 07:53:21 +0200 От: «Ваше имя» Возврат: Путь: Кому: rudzstyle@gmail.com Тема: =? 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: 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('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'] , укажите свой пароль для этой почты.

Это будет работать. Просто попробуйте. Надеюсь, это решит вашу проблему.

Вы можете найти свое решение из этих двух ссылок. Как настроить XAMPP для отправки почты с localhost?

http://thephpcode.blogspot.com/2009/03/setting-up-local-mail-smtp-pop3-imap.html