Help with PHPMailer and creating libraries in general |
[eluser]Cgull[/eluser]
Hello, Using codeigniter 2.1.2 I am developing a site where I email a few forms with codeingiter email library. Everything worked find until today when one of the emails gives me an error. I didn't change anything in the way I am sending the emails, but this one just fails. So, I did some research and found the PHPMailer plugin. Trying to work with this plugin gives me errors as well. So I have a few questions. I have downloaded the PHPMailer package. I put everything in: libraries/phpmailer/ I change the file name: class.phpmailer.php to phpmailer.php In this file I added these lines: Code: <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); First general question here: I use ion_auth in my site, when I look at their library file I don't see they use: $CI =& get_instance() they just use the normal $this, so why is it working for them and not for me? Then I created a file in: config/development/phpmailer.php: (My ENVIRONEMENT is set to development) Code: $config['SMTPAuth'] = true; // enable SMTP authentication Second general question: Reading the codeigniter user guide on create libraries: Quote:You can also pass parameters stored in a config file. Simply create a config file named identically to the class file name and store it in your application/config/ folder Did that, so why do I still need to load the config file? I have created a helper file: helpers/send_email_helper.php Code: <?php In my conroller I code: Code: $this->load->helper('send_email'); Submitting the form I get this error: Parse error: syntax error, unexpected T_VARIABLE in C:\sites\thinklocal\application\libraries\phpmailer\phpmailer.php on line 225 Line 225 in phpmailer.php is: Code: public $Host = $CI->config->item('Host'); Why do I get this error? Can someone please help? |
Messages In This Thread |
Help with PHPMailer and creating libraries in general - by El Forum - 04-30-2013, 02:28 AM
|