hello,
I am using this code to generate the PDF and attachment that PDF to
the email.
PDF is being generated but it does not be attached with email although
email does not send.
require_once("dompdf/dompdf_config.inc.php");
require_once("mime.php");
$html =
"<html><body>".
"<table> <tr> <td>First Name:</td><td>$fname</td> </tr>
<tr><td>Last Name:</td><td>$lname</td></tr>
<tr><td>Contact Number</td><td>$contact</td></tr>
<tr><td>Email:</td><td>$email</td></tr>
<tr><td>Message:</td><td>$message</td></tr>
</table>".
"</body></html>";
$dompdf = new DOMPDF();
$dompdf->load_html($html);
$dompdf->render();
file_put_contents("path/to/$fname.pdf", $dompdf->output());
$headers['To'] = '
imran....@hotmail.com';
$headers['Subject'] = 'PDF File email';
$mime = new Mail_mime();
$mime->setTXTBody('email body text');
$mime->addAttachment('path/to/sample.pdf');
$body = $mime->get();
$headers = $mime->headers($headers);
$mail =& Mail::factory('mail');
$mail->send('
nor...@imran.com', $headers, $body);
Please help me this regard,
Thank you,
Imran