Webador / SlmMail

Send mail from Laminas or Mezzio using external mail services.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add attachment support for Amazon SES

bakura10 opened this issue · comments

It seems that Amazon SES now support attachments (in fact it supports them since 2011, don't know why I didn't see it): http://aws.typepad.com/aws/2011/07/amazon-simple-email-service-now-supports-attachments.html).

We will need:

  • To add a SesMessage class
  • Change the send method in service to send attachments using the SendRawEmail method.

Any SES user is encouraged to do it =)

You don't need specific adapter classes if you want to support attachments. The abstract service layer can extract attachments (mime parts) for any Message class.

Ha yes exactly. It may be a bit easier then. I'll do it tomorrow :)

Envoyé de mon iPhone

Le 19 août 2013 à 23:39, Jurian Sluiman notifications@github.com a écrit :

You don't need specific adapter classes if you want to support attachments. The abstract service layer can extract attachments (mime parts) for any Message class.


Reply to this email directly or view it on GitHub.

I'm closing it. I give it a try, but we must rely on the sendRawEmail method of Amazon SES. However, Zend\Mail MUST really be buggy somewhere, as creating the raw email from the message generate completely different message.

It seems ZF2 still has the issue of rendering both HTML and text versions.

Hey did you manage to get this sorted out, also does it work only with ZF or ? does it work with any other framework too ?

No, I tried yesterday but a lot of problem arises because Zend\Mail has bug somewhere, so it would mean solving Zend\Mail bugs and its hard. So for SlmMail I'll stuck with pure API calls, and not creating the raw HTML string. So no attachments support for SES yet. But you can use a lot of other providers that provide that directly through the API (Mandrill for instance).

@bakura10 $message->toString() was not successful in converting the encoding as such SES could send the message?

Exactly. I still have the same problem than when I was trying to send emails manually. For instance, only sending the a HTML and text version does not work, I always receive both versions. After comparing what generate Zend\Mail and letting SES generate the email, SES uses a multipart\alternative content-type while Zend\Mail uses multipart\mixed. When sending attachments its even worse, using toString() send the attachment, but it's always 0 Kb. So I don't want to mess with Zend\Mail :(.

@bakura10, any news with this?

No news. I'm not using SES so I don't really have the courage to fix that. Last time I tried there was an annoying bug directly in Zend\Mail, that discouraged me to go any further :(.