codeigniter,phpmailer附件文件下载为无标题

时间:2016-09-20 08:35:33

标签: codeigniter phpmailer email-attachments

我正在使用带有Codeigniter的phpmailer发送带有pdf附件的电子邮件。 电子邮件发送成功,但是当从电子邮件下载pdf时,它将保存为无标题。 关于这个的任何想法?为什么会这样?

$pdf->Output(FCPATH . 'uploads/orderReport.pdf', 'F');
$config['mailtype'] = 'html';
$this->load->library('email', $config);
$subject = 'Order Reports for ' . date('d-m-Y', $start_date) . ' to'.
date('d-m-Y', $end_date);
$message = '<p>Hello Dear,</p>';
$message .= '<p>Please find Order report form ' . date('d-m-Y', $start_date) . ' to ' . date('d-m-Y', $end_date) . '</p>';
$message .= '<p>Regards</p>';
$this->email->attach(FCPATH . 'uploads/orderReport.pdf', '', '',       'application/pdf');
$this->email->from('no-replay@laviviane.com')
            ->to($email_address)
            ->subject($subject)
            ->message($message)
            ->send();

0 个答案:

没有答案