Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $mail = new Zend_Mail('utf-8');
- $mail->setType(Zend_Mime::MULTIPART_RELATED);
- $mail->setBodyHtml($html);
- $mail->setFrom('penawaran@mail.id', 'Nekindo');
- $mail->addTo('mail@mail.com', 'Syahidah Humairoh');
- $mail->setSubject('subject');
- try {
- $mail->send();
- Mage::getSingleton('core/session')->addSuccess('Your request has been sent');
- $this->_redirect('offer');
- }
- catch (Exception $e) {
- Mage::getSingleton('core/session')->addError('Unable to send.');
- $this->_redirect('offer');
- }
- $pdfName="Penawaran";
- $pdf->Output(Mage::getBaseDir().'/media/tmp/'.$pdfName.'.pdf', 'F');
- $pdfurl=Mage::getBaseDir().'/media/tmp/'.$pdfName.'.pdf';
- $mail->createAttachment(
- file_get_contents($pdfurl),
- 'application/pdf',
- Zend_Mime::DISPOSITION_ATTACHMENT,
- Zend_Mime::ENCODING_BASE64,
- $pdfName.'.pdf'
- );
- $mail->createAttachment(
- Zend_Pdf::load($pdfFilePath)->render(),
- 'application/pdf',
- Zend_Mime::DISPOSITION_ATTACHMENT,
- Zend_Mime::ENCODING_BASE64,
- 'My_Custom_Filename.pdf'
- );
Add Comment
Please, Sign In to add comment