No attachment received when using SendEmailMessage function

No attachment received when using SendEmailMessage function

In Updates 187 and earlier (possibly back to Update 182), when you specify an attachment in this function, the resulting email that is generated does not include the attachment itself but rather tries to embed it as shown in the example below.

 

To resolve this issue, simply specify the 'multipart/mixed' as the Content Type after the Port and SSL parameters. eg: 25,False,'multipart/mixed'

 

This is a multi-part message in MIME format

 --jvhacujouZwbka=_11qE1JQyEhPxAR7xXs

Content-Type: text/plain; charset="us-ascii"

Content-Transfer-Encoding: quoted-printable

Content-Disposition: inline

 

This is the body

 

--jvhacujouZwbka=_11qE1JQyEhPxAR7xXs

Content-Type: application/octet-stream;

          name="Item Trans A9800.xls"

Content-Transfer-Encoding: base64

Content-Disposition: attachment;

          filename="Item Trans A9800.xls"

 

0M8R4KGxGuEAAAAAAAAAAAAAAAAAAAAAPgADAP7/CQAGAAAAAAAAAAAAAAABAAAAAQAAAAAAAAAA

EAAA/v///wAAAAD+////AAAAAAAAAAD/////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////