If you ever need to get your Zend_Form_Element_File to be attached to your Zend_Mail, here’s how it’s done!
$mail = new Zend_Mail(); $at = new Zend_Mime_Part(file_get_contents($form->upload->getFileName())); $at->type = $form->upload->getMimeType(); $at->disposition = Zend_Mime::DISPOSITION_ATTACHMENT; $at->encoding = Zend_Mime::ENCODING_BASE64; $at->filename = basename($form->upload->getFileName()); $mail->addAttachment($at);
Advertisements