How can I attach a PDF file in a mail using CodeIgniter?
I received mail. But I didn't find any attachment in that.
I am using the following code:
public function sendmail()
{
$this->load->library('email');
$config['upload_path'] = './uploads/';
$config['allowed_types'] = 'gif|jpg|png';
$config['max_size'] = '100000';
$config['max_width'] = '1024';
$config['max_height'] = '768';
$this->load->library('upload', $config);
$this->upload->do_upload('attachment');
$upload_data = $this->upload->data();
$this->email->set_newline("\r\n");
$this->email->set_crlf("\r\n");
$this->email->from('sskwebtech@gmail.com');
$this->email->to($this->input->post('to'));
$this->email->subject($this->input->post('subject'));
$this->email->message($this->input->post('message'));
if ($this->email->send()) {
echo "Mail Send";
return true;
} else {
show_error($this->email->print_debugger());
}
}