• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
send() function returns true but no email is received in the inbox

#1
[eluser]Unknown[/eluser]
Hello all,

I am new to CodeIgniter and I am stuck in implementing the Email class.Please can anyone check my below code in order to send an email from my gmail account to the same gmail account? When I run it, it says Email sent(send() return true). But I cannot find any such email in my inbox. Can anyone suggest what the problem can be?
Code:
$config = Array(
        'protocol' => 'smtp',
        'smtp_host' => 'ssl://smtp.googlemail.com',
        'smtp_port' => 465,
        'smtp_user' => 'koolpraju@gmail.com',
        'smtp_password' => '****',
        'mailtype' => 'html',
        'charset' => 'iso-8859-1'
    );

    $this->load->library('email', $config);


    $this->email->set_newline("\r\n");

    $this->email->from('koolpraju@gmail.com','Prajakta');
    $this->email->to('koolpraju@gmail.com');
    $this->email->subject('This is a test email');
    $this->email->message('It is working. Great!! yey');

    if($this->email->send())
    {
        echo 'Your email was sent successfully';

    }
    else
    {
        show_error($this->email->print_debugger());
    }

I have Xampp running with Mercury and have set up Mercury S SMTP Server parameters. I really dont understand why the emails are not going through? Can somebody help me with this issue?

Any help would be very much appreciated.

Cheers!
PG

#2
[eluser]BigBad[/eluser]
Did you check your servers mail logs to see if it stuck there?


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.