CodeIgniter Forums
send() function returns true but no email is received in the inbox - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: send() function returns true but no email is received in the inbox (/showthread.php?tid=52804)



send() function returns true but no email is received in the inbox - El Forum - 06-27-2012

[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' => '[email protected]',
        'smtp_password' => '****',
        'mailtype' => 'html',
        'charset' => 'iso-8859-1'
    );

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


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

    $this->email->from('[email protected]','Prajakta');
    $this->email->to('[email protected]');
    $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


send() function returns true but no email is received in the inbox - El Forum - 06-27-2012

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