Quantcast
Channel: Active questions tagged email - Stack Overflow
Viewing all articles
Browse latest Browse all 29745

how to attach pdf file in mail function using codigniter?

$
0
0

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());
    }
}

Viewing all articles
Browse latest Browse all 29745

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>