Welcome Guest, Not a member yet? Register   Sign In
Codeigniter sending blank emails when more then one email is sent in a single request
#8

So, I am even more confused then I was before, using the following code on a fresh install all the emails send fine.

PHP Code:
<?php
defined
('BASEPATH') OR exit('No direct script access allowed');

class 
Welcome extends CI_Controller {

    public function 
index() {

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

        
$config = array(
            
'mailtype'  => 'html',
            
'useragent' => 'Codeigniter Test',
            
'protocol'  => 'smtp',
            
'smtp_host' => '173.194.67.108',
            
'smtp_port' => 587,
            
'smtp_user' => '[email protected]',
            
'smtp_pass' => 'mypassword',
            
'smtp_crypto'=>'tls'
        
);
    
        
$this->email->initialize($config);

        
$this->email->set_newline("\r\n");

        
$emails = array(
            
'[email protected]',
            
'[email protected]',
            
'[email protected]'
        
);

        foreach(
$emails as $to) {

            
$this->email->to($to); 

            
$this->email->from('[email protected]''My Name');
            
            
$this->email->subject('Codeigniter Email Test');
            
            
$this->email->message$this->load->view('welcome_message',array(),true) );
            
            
$result $this->email->send();

        }
        
    }

Reply


Messages In This Thread
RE: Codeigniter sending blank emails when more then one email is sent in a single request - by webdev25 - 09-21-2015, 09:28 PM



Theme © iAndrew 2016 - Forum software by © MyBB