Welcome Guest, Not a member yet? Register   Sign In
email.php Config Bug?
#1

[eluser]wlvrn[/eluser]
Hello,

I'm having trouble sending an email.

If I used the controller-based setup, like this...
Code:
$config['protocol'] = 'sendmail';
$config['mailpath'] = '/usr/sbin/sendmail';
$config['charset'] = 'iso-8859-1';
$config['wordwrap'] = TRUE;

$this->email->initialize($config);
... my email is sent fine. If I, however, attempt to create an email.php file and place it in my system/application/config directory and paste that exact same $cofig array into it, I get the following error...
Code:
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.
Oddly enough, if I change the email.php file to use "mail" instead of "smtp", I get the SAME error which leads me to think that the email.php isn't being used when the controller attempts to send the email.

Has anyone else noticed this?
#2

[eluser]CARP[/eluser]
I'm having this error too, today
I've created an email.php inside config folder, and made the email library to autoload, but seems isn't taking in consideration the config/email.php file
#3

[eluser]-sek[/eluser]
I want to send mail through a commercial smtp service. I created an email.php file, placed my configuration information in there, and located it in /system/application/config without any luck. It still uses the 'mail' protocol. The manual did not say to create an entry in autoload, should I do that?

I am using this along with FAL authentication library, which may be interfering with the configuration being pulled from the config. When I place an email debug call in the FAL email code, I can see it still maintains the default email settings from the Email class, so the config is not being loaded.

I can send mail fine from my own independent controller.
#4

[eluser]SBH[/eluser]
I just experienced this today for the first time. It happened as I am trying to migrate my code from running on a linux to a windows server. Could that have anything to do with it?
#5

[eluser]Popcorn[/eluser]
Quote:The manual did not say to create an entry in autoload, should I do that?

Yes, otherwise CodeIgniter doesn't know the config file exists.
#6

[eluser]SBH[/eluser]
[quote author="Popcorn" date="1230965281"]
Quote:The manual did not say to create an entry in autoload, should I do that?

Yes, otherwise CodeIgniter doesn't know the config file exists.[/quote]

What do you mean create an entry in autoload? What do I put into the autoload.php file? Is there any way to debug the email class properties after it is loaded? Is there a $this->email->protocol?




Theme © iAndrew 2016 - Forum software by © MyBB