如何在Amazon SES服务上发送带附件的邮件

时间:2013-10-30 05:52:09

标签: zend-framework amazon-web-services amazon-s3 amazon-ec2 amazon

您好,我无法发送带附件的邮件我的代码:

$sendername ='Admin';
         $senderemail ='kraj@seasiaconsulting.com';
         $recipentemail = 'kraj@seasiaconsulting.com';

         $se = new Zend_Service_Amazon_Ses_Email();
         $mail = new Zend_Service_Amazon_Ses_Email();
         $mail->setBodyHtml($message);
         $mail->setFrom($senderemail,$sendername);
         $mail->addTo($recipentemail,$recipentname);
         $mail->addCc($senderemail,$sendername);
         $mail->setReturnPath($senderemail);
         $mail->setSubject($subject);
         //attachments code
         if($filesPathArray){ 

                //$at = new Zend_Mime_Part($filesPathArray["pdf"]);
                 $at = new Zend_Mime_Part($filesPathArray["pdf"]);
                 $at->type = 'pdf';

                //$at->filename = basename($filesPathArray["pdf"]);
                 $at->filename = $filesPathArray["pdf_name"];
                 $at->disposition = Zend_Mime::DISPOSITION_INLINE;
                 $at->encoding = Zend_Mime::ENCODING_BASE64;
                 $mail->addAttachment($at);

         }

        $ses = new Zend_Service_Amazon_Ses();
        $messageId = $ses->sendEmail($mail);

0 个答案:

没有答案