Hi!
I have a function to send an email to a group of users (newsletter). The strange thing is that it sends the email but it goes without content! I already tried HTML email and Plain. Both goes without content.
Here’s the function:
public function send() {
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'localhost',
'smtp_user' => 'xxxxx',
'smtp_pass' => 'xxxxx',
'validate' => TRUE ,
'priority' => 3 , //1-high,3-medium,5-normal
//'mailtype' => 'html',
//'wordrap' => TRUE,
'crlf' => "\r\n" ,
'newline' => "\r\n",
'bcc_batch_mode' => TRUE
);
$this->email->initialize($config);
$this->email->from('geral@mail.com', 'nome');
$this->email->bcc($this->input->post('enderecos'));
$this->email->subject($this->input->post('subject'));
/*$message = "<html><body>";
$message .= "<h1>Página Literária do Porto</h1>";
$message .= "<h3>newsletter</h3>";
$message .= "<div>".$this->input->post('message')."</div>";
$message .= "<p>Contacto: </p>";
$message .= "</body></html>";*/
$message = $this->input->post('message');
if (!$this->email->send($message)) show_error($this->email->print_debugger());
else {
$this->newsletters_model->set_newsletter();
$this->index('A newsletter foi enviada com sucesso');
}
}
Another thing… as you can see I save the email sent on a database table. I checked the record and it stores all the information (including the message)...
Any ideas?!
Thanks in advance!
