Welcome Guest, Not a member yet? Register   Sign In
[Solved] Email Config File Question
#1

(This post was last modified: 07-25-2015, 08:24 PM by wolfgang1983.)

I have created a email.php config file in

application > config > email.php

I would like to know if I load $this->load->library('email');

Does it detect the config email.php automatic?


PHP Code:
public function send() {


$this->load->library('form_validation');

$this->form_validation->set_rules('subject''E-Mail Subject''required');
$this->form_validation->set_rules('message''E-Mail Message''required');

if (
$this->form_validation->run() == FALSE) {

$this->index();

} else {

$this->load->library('email');

switch (
$this->input->post('to')) {
                
case 
'newsletter':    

$results $this->get_news_letter_emails();
                     
   
foreach ($results as $result) {

$this->email->from(config_item('email'), config_item('website_name'));
$this->email->to($result['email']);
$this->email->subject($this->input->post('subject')); 
$this->email->message($this->input->post('message'));
                     
   
$this
->email->send();
}

$this->session->set_flashdata('success''Email Sent Success');
redirect('admin/mail');

break;

}



application > config > email.php

PHP Code:
<?php

$config
['protocol'] = 'smtp';
$config['smtp_host'] = '***';
$config['smtp_port'] = 465;
$config['smtp_user'] = '***';
$config['smtp_pass'] = '***'
There's only one rule - please don't tell anyone to go and read the manual.  Sometimes the manual just SUCKS!
Reply


Messages In This Thread
[Solved] Email Config File Question - by wolfgang1983 - 07-24-2015, 08:33 PM
RE: Email Config File Question - by Diederik - 07-24-2015, 09:01 PM
RE: Email Config File Question - by Dracula - 07-25-2015, 02:50 AM
RE: Email Config File Question - by Wouter60 - 07-25-2015, 03:42 AM



Theme © iAndrew 2016 - Forum software by © MyBB