Это то, что я сделал в своем приложении, пожалуйста, просмотрите его, и если у вас есть какие-либо сомнения, дайте мне знать.
Я предполагаю, что вы можете отправлять почту из своего приложения.
$pdf = $dompdf->output();
$file_location is the path where you saved your pdf file in your local host.
file_put_contents($file_location,$pdf);
Now call your mail function like this.
sendMail($from,$to,$subject,$message,$file_location);
function sendMail()
{
$config = Array(
'protocol' => 'smtp',
'smtp_host' => 'ssl://smtp.googlemail.com',
'smtp_port' => 465,
'smtp_user' => '[email protected]', // change it to yours
'smtp_pass' => 'xxx', // change it to yours
'mailtype' => 'html',
'charset' => 'iso-8859-1',
'wordwrap' => TRUE
);
$this->load->library('email', $config);
$this->email->set_newline("\r\n");
$this->email->from($from); // change it to yours
$this->email->to($to);// change it to yours
$this->email->subject($subject);
$this->email->message($message);
$this->email->attach($file_location);
if($this->email->send())
{
echo 'Email sent.';
}
else
{
show_error($this->email->print_debugger());
}
}
Теперь напишите почтовую функцию, как я упоминал в комментариях.
person
Venkata Krishna
schedule
31.01.2013