WriteHTML($email_html);
// JPATH_COMPONENT_SITE should be writeable or use other temp directory to create pdf
$mpdf->Output(JPATH_COMPONENT_SITE.DS.'file_'.$seed.'.pdf','F');
// mail
$mailer =& JFactory::getMailer();
$mailer->isHTML(true);
$mailer->setSubject('Email with attach');
// mail to
$mailer->addRecipient($email);
$mailer->addAttachment(JPATH_COMPONENT_SITE.DS.'file_'.$seed.'.pdf');
$mail_content='Form mail content: '.$text;
$mailer->setBody($mail_content);
$mailer->Send();
//Delete file created
JFile::delete(JPATH_COMPONENT_SITE.DS.'file_'.$seed.'.pdf');]]>
Send Email with PDF to |
##email## |
PDF Text |
##pdftext## |
Mail text |
##text## |
]]>
Email sent!!]]>