Welcome Guest, Not a member yet? Register   Sign In
No Error, but also no any thing!! E-mailing seems impossible! Any suggestions?
#1

[eluser]ad0mw[/eluser]
Hi Guys,

I have researched this problem all over and can only ever find the same suggested solution to this problem code of mine after following the codeIgniter From Scratch Day 3 - email tutorial.

I get no debugger errors but I also don't get anything appearing at all in safari and in chrome i only get the error:
Quote:The website encountered an error while retrieving http://localhost/ci/index.php/email/. It may be down for maintenance or configured incorrectly.


Code:
<?php


class Email extends CI_Controller
{

    function __construct()
    {
        parent::Controller();
    }
    
    function index()
    {
        $config = Array(
            'protocol' => 'smtp',
            'smtp_host' => 'ssl://smtp.gmail.com',
            'smtp_port' => 465,
            'smtp_user' => '********@gmail.com',
            'smtp_pass' => '********'
        );
            
        $this->load->library('email', $config);
        
        $this->email->set_newline("\r\n");
        
        $this->email->from('******@gmail.com');
        $this->email->to('*******@gmail.com');
        $this->email->subject('this is an email test');
        $this->email->message('Test email biatch');
        
        if($this->email->send())
        {
            echo 'Mail sent';
        }
        
        else
        {
            show_error($this->email->print_debugger());
        }
    }
    
}


for this line [code]'smtp_host' => 'ssl://smtp.gmail.com',] ive used: ssl://, sslv2:// and https:// (non of which solved my problem)

I then did further research and some people had a problem with enabling 'php_openssl' by uncommenting the line in php.ini
;extension=php_openssl.dll


when I go into my application > mamp > conf > php5.2 (and/or php5.3) >
php.ini and try find the line to edit it does not exist, nor have I been able to find a solution to rectify it being there.

I'm lost for answers and have given in to posting


This also being my first on CI forms and im sure only 1 of many to come!

Thank you!
#2

[eluser]ad0mw[/eluser]
Solved I think ...

changed

Code:
function __construct()
    {
        parent::Controller();
    }

to
Code:
function emailer()
    {
        parent::Controller();
    }

mail sends no problem.. hmm
#3

[eluser]InsiteFX[/eluser]
If you are running CI 2.0.1

Then it is like this!
Code:
function __construct()
{
   parent::__construct();
}

InsiteFX
#4

[eluser]ad0mw[/eluser]
Awesome, thank you!
#5

[eluser]InsiteFX[/eluser]
Your very Welcome!




Theme © iAndrew 2016 - Forum software by © MyBB