Welcome Guest, Not a member yet? Register   Sign In
Problems with email->attach and message dissapearing
#1

[eluser]thors1982[/eluser]
I am trying to send two emails one with a file attached.

Both emails work perfectly with no attachment (just plain text). But if I add an attachment to the first email... both emails go completely blank... absolutely no text. However the attachment does work on the first email.

Code:
//First Email
$this->load->library('email');
$this->email->clear();

$this->email->from($vars->email);
$this->email->to($pagemeta->email, $pagemeta->name);

$this->email->attach($filename);

$this->email->subject($pagemeta->subject);

$this->email->message("Test copy goes here");

$this->email->send();
//Second Email
$this->email->clear();

$this->email->from($pagemeta->email, $pagemeta->name);
$this->email->to($vars->email);

$this->email->subject($pagemeta->subject);

$this->email->message("Test copy goes here");

$this->email->send();

Any suggestions?
#2

[eluser]Jan_1[/eluser]
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'localhost';
$config['validate'] = 'TRUE';
$this->email->initialize($config);




Theme © iAndrew 2016 - Forum software by © MyBB