如何使用CodeIgniter在邮件中附加PDF文件?
我收到了邮件。但我没发现里面有任何附件。
我使用了以下代码:
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());
}
}
https://stackoverflow.com/questions/50774357
复制相似问题