Welcome Guest, Not a member yet? Register   Sign In
Email Config Bug Report
#1

[eluser]Unknown[/eluser]
I've encountered the same bug as these people in this thread.
http://ellislab.com/forums/viewthread/82683/

I also tried renaming email.php to Email.php as encountered in this thread - no luck
http://ellislab.com/forums/viewthread/89514/

Supposedly the userguide on the email class says you can create a $config array in /config/email.php and it should work however it does not.

/config/email.php
Code:
$config['smtp_host'] = 'smtp.mindspring.com';

/config/autoload.php

Code:
$autoload['config'] = array('email', 'redux_auth');
$autoload['libraries'] = array('database', 'email', 'validation', 'redux_auth');

Email Code


Code:
$this->email->from('[email protected]', 'Your Name');
        $this->email->to('[email protected]');

        $this->email->subject('Email Test');
        $this->email->message('Testing the email class.');

        $this->email->send();
        echo $this->config->item('smtp_host');
echo $this->email->print_debugger();

I even set it to autoload the config and it doesn't work.

This is what I get when printing the debug call.

Quote:You did not specify a SMTP hostname.
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

Note, I tried sending email via php's native mail() function and it worked fine.

Thanks
#2

[eluser]Unknown[/eluser]
I figured it out.

It was redux_auth causing the problem with it's own email config.

Case closed..
#3

[eluser]Julien Desrosiers[/eluser]
Thanks for sharing! I had the same problem (i use redux too) and it gave me the idea to look into my redux_auth files.

in libraries/redux_auth.php i commented out this line in the __construct() method :
Code:
$this->ci->email->initialize($this->mail);

And in config/redux_auth.php i commented out these lines :
Code:
$config['auth']['mail']['mailtype']        = 'html';
$config['auth']['mail']['protocol']     = 'smtp';
$config['auth']['mail']['smtp_host']     = '';
$config['auth']['mail']['smtp_user']     = '';
$config['auth']['mail']['smtp_pass']     = '';
$config['auth']['mail']['smtp_port']     = '';
$config['auth']['mail_from_email']         = '';
$config['auth']['mail_from_name']         = '';

I don't know if its the right way but it works. I don't use the email features of redux_auth. But if someone uses it, he may find another solution for this.

Thanks again!

Julien
#4

[eluser]-sek[/eluser]
I found the other thread you mention first and posted. I have the same problem with email.php config being overridden somewhere. I suspect I have a similar situation with FAL auth system somehow overriding the config file. I've looked at the code and cannot see why it would be doing this...of course, it may be that the email.php config is not loading.

I've tried my own controller and initializing the Email class and config myself and it works fine.

I guess the next step is to see if my own controller picks up the config from email.php but if it doesn't, it must be somewhere in FAL code.

I did get the FAL code to work by hacking in the email config array and calling email->initialize method.

Any help appreciated.
#5

[eluser]spiderking[/eluser]
CodeIgniter Version 2.1.0
hey everybody I also had a similar problem . But here is what I did to solve the issue .

In my config file 'email.php' I have just commented out the $config['protocol']= 'smtp' and it's working perfectly :-) . I dunno why but I wonder if there is something wrong by it like that

Code:
<?php if(!defined('BASEPATH')) exit ('No direct script access allowed');
Code:
//$config['protocol']= 'smtp';
Code:
$config['smpt_host']= 'ssl://smtp.gmail.com';
Code:
$config['smtp_port']= 465;






Theme © iAndrew 2016 - Forum software by © MyBB