CodeIgniter Forums
CI does't see the configuration email.php - 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: CI does't see the configuration email.php (/showthread.php?tid=33681)



CI does't see the configuration email.php - El Forum - 09-04-2010

[eluser]mitring[/eluser]
Hi,

I have problem with configuration a email class:
myfile: application\config\email.php

Code:
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = '\r\n';

//$config['protocol'] = 'smtp';

// konfiguracja poczty
$config = array(
    'protocol' => 'smtp',
    'smtp_host' => 'serwer.com.pl',
    'smtp_user' => '[email protected]',
    'smtp_pass' => 'tajnehaslo',
    'smtp_port' => 587,

);

and now:
Code:
var_dump($this->email->mailtype);
return text :|

I tried Email.php / email.php Sad

CI: 1.7.2
WAMP: 2.0
Win7 Pro x64

Best regards
Peter


CI does't see the configuration email.php - El Forum - 09-05-2010

[eluser]slowgary[/eluser]
Hi Peter,

When you assign $config = array(), you wipe out the previous value of $config. Also, you'll need to call the initialization function somewhere...
Code:
$this->email->initialize($config);

I recommend you read the user guide to better understand how CodeIgniter works...
http://ellislab.com/codeigniter/user-guide/libraries/email.html
http://ellislab.com/codeigniter/user-guide/libraries/config.html

Also, for better answers to your questions, try posting a more complete code sample next time.

I hope this helps!


CI does't see the configuration email.php - El Forum - 09-05-2010

[eluser]mitring[/eluser]
Thanks, your answer is correctSmile my mistake.

Thanks

Reg
Peter