• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Solved] Email Config File Question

#1
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

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.