Note that there are some explanatory texts on larger screens.

plurals
  1. POMime and Office365
    primarykey
    data
    text
    <p>We are receiving corrupted emails with PDF attachments from our PHP/Zend application. We just recently migrated to MS Office365. MS telling us that MIME format is not supported by Office365.</p> <p>The emails get corrupted only when they have attachments. Zend form emails in MIME format by default. What are our options? How can we send emails with PDF attachments, from PHP/Zend application through office365?</p> <p><strong>EDIT 1</strong></p> <p>PHP code which sends the email:</p> <pre><code>$mail = new Zend_Mail(); $mail-&gt;setFrom(Zend_Registry::get('config')-&gt;app-&gt;contact-&gt;email); $mail-&gt;addTo($this-&gt;getUscEmail(), $this-&gt;getFirstName().' '.$this-&gt;getLastName()); $mail-&gt;addCc(Zend_Registry::get('config')-&gt;app-&gt;contact-&gt;email, 'SOWK FWS'); $mail-&gt;setSubject('Workstudy Documentation - '.$this-&gt;getFirstName().' '.$this-&gt;getLastName()); $mail-&gt;setBodyText('Hi '.$this-&gt;getFirstName().",\r\n".'Congratulations on completing your FWS Orientation!'); $file = Zend_Registry::get('config')-&gt;app-&gt;pdf_path."CertificateAndAgreement.pdf"; //load pdf from string $pdf = Zend_Pdf::load($file); $font = Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA); $page = $pdf-&gt;pages[0]; $page-&gt;setFont($font, 12); $page-&gt;drawText($this-&gt;getFirstName().' '.$this-&gt;getLastName(), 72, 133); $uscId = $this-&gt;getUscId(); $page-&gt;drawText(substr($uscId, 0, 4).'-'.substr($uscId, 4, 2).'-'.substr($uscId, -4), 340, 133); $at = $mail-&gt;createAttachment($pdf-&gt;render()); $at-&gt;filename = "CertificateAndAgreement.pdf"; $at-&gt;type = 'application/pdf'; $file = Zend_Registry::get('config')-&gt;app-&gt;pdf_path."FWSOrientationHandouts.pdf"; //load pdf from string $contents = file_get_contents($file); $at2 = $mail-&gt;createAttachment($contents); $at2-&gt;filename = "Handouts.pdf"; $at2-&gt;type = 'application/pdf'; $mail-&gt;send(); </code></pre> <p><strong>And this is an example of email we are getting:</strong></p> <pre><code> This is a message in Mime Format. If you see this, your mail reader does not support this format. --_c0af0986a1041f0bc7afd728e445b8db Content-Type: text/plain; charsetiso-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Congratulations on completing your FWS Orientation! --_c0af0986a1041f0bc7afd728e445b8db Content-Type: application/pdf Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename"CertificateAndAgreement.pdf" JVBERi0xLjUNCiW1tbW1DQoxIDAgb2JqDQo8PC9UeXBlL0NhdGFsb2cvUGFnZXMgMiAwIFIv TGFuZyhlbi1VUykgL1N0cnVjdFRyZWVSb290IDIxIDAgUi9NYXJrSW5mbzw8L01hcmtlZCB0 cnVlPj4+Pg0KZW5kb2JqDQoyIDAgb2JqDQo8PC9UeXBlL1BhZ2VzL0NvdW50IDEvS2lkc1sg MyAwIFJdID4+DQplbmRvYmoNCjMgMCBvYmoNCjw8L1R5cGUvUGFnZS9QYXJlbnQgMiAwIFIv UmVzb3VyY2VzPDwvRm9udDw8L0YxIDUgMCBSL0YyIDcgMCBSL0YzIDkgMCBSL0Y0IDE0IDAg Ui9GNSAxNiAwIFIvRjYgMTggMCBSPj4vUHJvY1NldFsvUERGL1RleHQvSW1hZ2VCL0ltYWdl Qy9JbWFnZUldID4+L01lZGlhQm94WyAwIDAgNjEyIDc5Ml0gL0NvbnRlbnRzIDQgMCBSL0dy b3VwPDwvVHlwZS9Hcm91cC9TL1RyYW5zcGFyZW5jeS9DUy9EZXZpY2VSR0I+Pi9UYWJzL1Mv U3RydWN0UGFyZW50cyAwPj4NCmVuZG9iag0KNCAwIG9iag0KPDwvRmlsdGVyL0ZsYXRlRGVj b2RlL0xlbmd0aCAxMjI1NT4+DQpzdHJlYW0NCnicvZ1ZkxzHkeffacbvkA/zgF4jU3kfszKZ rXhInKWOEaCRyaS1tQK6iOYK6IIa3YK4n378iOPvlVnV5Vk7KxkBVHd4+i8Oj/CIcM8qfvb7 ... [here comes a lot of garbage instead of PDF file] </code></pre> <p><strong>Here is the header of this message</strong></p> <pre><code> Received: from BY2PRD0712HT001.namprd07.prod.outlook.com (10.255.246.34) by BL2PRD0711HT005.namprd07.prod.outlook.com (10.255.104.168) with Microsoft SMTP Server (TLS) id 14.16.329.3; Thu, 11 Jul 2013 17:58:15 +0000 Received: from BY2PRD0712HT003.namprd07.prod.outlook.com (10.255.246.36) by BY2PRD0712HT001.namprd07.prod.outlook.com (10.255.246.34) with Microsoft SMTP Server (TLS) id 14.16.329.3; Thu, 11 Jul 2013 17:58:14 +0000 Received: from mail39-co1-R.bigfish.com (216.32.180.180) by BY2PRD0712HT003.namprd07.prod.outlook.com (10.255.246.36) with Microsoft SMTP Server (TLS) id 14.16.329.3; Thu, 11 Jul 2013 17:58:08 +0000 Received: from mail39-co1 (localhost [127.0.0.1]) by mail39-co1-R.bigfish.com (Postfix) with ESMTP id 1E9AF1000A2 for &lt;username@exchange.usc.edu&gt;; Thu, 11 Jul 2013 17:58:08 +0000 (UTC) X-Forefront-Antispam-Report: CIP:128.125.137.218;KIP:(null);UIP:(null);IPV:NLI;H:msg-ironport3.usc.edu;RD:msg-ironport3.usc.edu;EFVD:NLI X-SpamScore: 0 X-BigFish: ps0(zzzz1f42h1d77h1ee6h1de0h1fdah2073h1202h1e76h1d1ah1d2ah1fc6hzzz2fh2a8h668h839hd24h1288h12a5h12a9h12bdh12e5h137ah13b6h13eah1441h14ddh1504h1537h153bh162dh1631h1758h18b6h18e1h1946h19b5h1b0ah1d0ch1d2eh1d3fh1dc1h1dfeh1dffh1e1dh35h1155h) Received-SPF: pass (mail39-co1: domain of usc.edu designates 128.125.137.218 as permitted sender) client-ip=128.125.137.218; envelope-from=someuser@usc.edu; helo=msg-ironport3.usc.edu ;ort3.usc.edu ; Received: from mail39-co1 (localhost.localdomain [127.0.0.1]) by mail39-co1 (MessageSwitch) id 1373565485428745_21893; Thu, 11 Jul 2013 17:58:05 +0000 (UTC) Received: from CO1EHSMHS001.bigfish.com (unknown [10.243.78.249]) by mail39-co1.bigfish.com (Postfix) with ESMTP id 25BEBE0062 for &lt;username@exchange.usc.edu&gt;; Thu, 11 Jul 2013 17:58:05 +0000 (UTC) Received: from msg-ironport3.usc.edu (128.125.137.218) by CO1EHSMHS001.bigfish.com (10.243.66.11) with Microsoft SMTP Server (TLS) id 14.1.225.23; Thu, 11 Jul 2013 17:57:55 +0000 X-IronPort-AV: E=Sophos;i="4.89,1045,1367996400"; d="scan'208";a="240502123" Received: from email-staff.usc.edu ([128.125.137.21]) by msg-ip3.usc.edu with ESMTP; 11 Jul 2013 10:55:50 -0700 MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain Received: from msg-ironport2.usc.edu (msg-ironport2.usc.edu [128.125.137.216]) by email-staff.usc.edu (Sun Java(tm) System Messaging Server 7u3-17.01 64bit (built Jun 8 2010)) with ESMTP id &lt;0MPS00KPP9SN3A70@email-staff.usc.edu&gt; for username@exchange.usc.edu (ORCPT username@usc.edu); Thu, 11 Jul 2013 10:55:47 -0700 (PDT) Authentication-results: msg-ironport2.usc.edu; dkim=neutral (message not signed) header.i=none Message-ID: &lt;45927a$14o9gj0@msg-ironport2.usc.edu&gt; X-IronPort-AV: E=Sophos;i="4.89,1045,1367996400"; d="pdf'?scan'208";a="1233437287" Received: from sowksec1.usc.edu (HELO SOWKSEC1) ([68.181.121.7]) by msg-ironport2.usc.edu with SMTP; Thu, 11 Jul 2013 10:55:39 -0700 Subject: Workstudy Documentation - Viktor Raskin To: &lt;username@usc.edu&gt; From: &lt;username@usc.edu&gt; CC: SOWK FWS &lt;username@usc.edu&gt; Date: Thu, 11 Jul 2013 10:55:39 -0700 Return-Path: someuser@usc.edu X-MS-Exchange-Organization-SCL: -1 X-MS-Exchange-Organization-AVStamp-Mailbox: MSFTFF;1;0;0 0 0 X-MS-Exchange-Inbox-Rules-Loop: username@usc.edu X-MS-Exchange-Organization-AuthSource: BY2PRD0712HT003.namprd07.prod.outlook.com X-MS-Exchange-Organization-AuthAs: Anonymous </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload