Welcome Guest, Not a member yet? Register   Sign In
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' => '[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
#2

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




Theme © iAndrew 2016 - Forum software by © MyBB