Welcome Guest, Not a member yet? Register   Sign In
email settings?
#1

[eluser]anna16[/eluser]
Hello

I created email.php file and save it under /application/config directory
in my controller I have this test method below,
Code:
function email_test()
  {
    $this->load->library('email', $config);
  
    $this->email->from('[email protected]', 'Admin');
    $this->email->to('[email protected]');

    $this->email->subject('Activate your account - email test');
    $this->email->set_alt_message('Pleae click the link below to activate your account at samplesite.com<br><a href="coder9.com">click here</a>');
    #$this->email->set_alt_message('Pleae click the link below to activate your account at samplesite.com<br><a href="coder9.com">click here</a>');    
    $this->email->send();  
    echo $this->email->print_debugger();
  }

I tested it and i got an error message below,
Code:
Message: Undefined variable: config
Filename: membership/site.php
Line Number: 103

The line number 103 is this code below,
Code:
$this->load->library('email', $config);

well the manual said all i need to do is just define the $config variable inside the email.php

What should i do with this $config variable? should i remove it?

Thanks in advanced.
#2

[eluser]Bart Mebane[/eluser]
You only need the $config variable to set options, like
Code:
$config['mailtype'] = 'text';
The available options are listed in the User Guide under Email class. If you don't need to configure any options, you should either omit the $config variable and just use
Code:
$this->load->library('email');
or set $config to an empty array.
#3

[eluser]InsiteFX[/eluser]
Also you will not need to do this.
Code:
$this->email->initialize();

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB