有人知道如何使用codeigniter和phpmailer自动生成自动生成的pdf然后,请帮助
$this->load->library('email');
$this->email->from('your@example.com', 'Your Name');
$this->email->to('someone@example.com');
$this->email->cc('another@another-example.com');
$this->email->bcc('them@their-example.com');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
$this->email->send();
答案 0 :(得分:0)
你显然缺少几行代码......
我在生成这个代码后还包含了pdf的电子邮件:
$pdf = $this->generatePdf();
foreach ($pdf as $p)
$this->email->attach('./barcodes/' . $p . '.pdf');
现在进行一些言论:
$pdf = $this->generatePdf();
这用于实际生成和存储pdf,结果将是一个包含实际pdf名称的数组。
foreach ($pdf as $p)
$this->email->attach('./barcodes/' . $p . '.pdf');
用于遍历生成的pdf名称数组并实际包含它们,codeigniters电子邮件库具有attach
功能,允许您添加附件。