0

I am using HMVC with Codeigniter, with XAAMP on Windows. I am unable to receive even the sample email from the Codeigniter docs. The email->print_debugger() echoes that 'the message has been successfully sent using the following protocol: mail' and everything seems right in the message. However I do not receive them in my inbox (or spam) for my gmail and yahoo accounts. Do I need some additional setup for sending emails? In my controller I have the following function...

public function send_mail() {
    $this->load->library('email');  

    $this->email->from('my_account@gmail.com', 'MyName');
    $this->email->to('my_account@yahoo.com'); 
    $this->email->subject('test subject');
    $this->email->message('test content');

    if($this->email->send()) {
        echo $this->email->print_debugger(); 
        echo "success";
    } else {            
        echo $this->email->print_debugger();
        echo "failed";
    }
}

Thanks

Besto
  • 109
  • 1
  • 11
  • 1
    By default xampp not send emails to real mailboxes. Xampp can store emails on local storage (need to specify sendmail options in php.ini) or you can use smtp to send real emails – joni jones Jan 04 '14 at 19:50
  • Also, if you want to store local mails, you can use simple script in this answer http://stackoverflow.com/a/18185126/1613335 – joni jones Jan 04 '14 at 19:59
  • Thanks Joni. I tried to configure XAMPP following the instructions in [link](http://stackoverflow.com/questions/15965376). I also changed my CI code to the following... – Besto Jan 05 '14 at 05:33
  • Now I am getting a **PHP Error: fsockopen():SSL operation failed with code 1**. – Besto Jan 05 '14 at 05:40
  • Used port 465 instead of 587 and it works. Thanks again. – Besto Jan 05 '14 at 08:58

1 Answers1

0

You need to configure SMTP with XAMPP on windows. Follow How to configure XAMPP to send mail from localhost? to configure SMTP.

Community
  • 1
  • 1