CodeIgniter Forums
No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - 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: No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? (/showthread.php?tid=40354)



No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - El Forum - 04-06-2011

[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!


No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - El Forum - 04-07-2011

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

changed

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

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

mail sends no problem.. hmm


No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - El Forum - 04-07-2011

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

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

InsiteFX


No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - El Forum - 04-07-2011

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


No Error, but also no any thing!! E-mailing seems impossible! Any suggestions? - El Forum - 04-07-2011

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