使用亚马逊SES附件发送电子邮件

编程入门 行业动态 更新时间:2024-10-11 09:26:37
本文介绍了使用亚马逊SES附件发送电子邮件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我试图发送包含使用亚马逊SES API附件(PDF文件)的电子邮件。

I am trying to send an email that contains an attachment (a pdf file) using the amazon SES API.

我使用Symfony2的,所以我包含在我的项目AmazonWebServiceBundle。 我可以轻松地发送一个简单的电子邮件(即没有附件)pretty的有以下code:

I am using Symfony2 so I included the AmazonWebServiceBundle in my project. I can send a simple email (that has no attachment) pretty easily with the following code:

$ses = $this->container->get('aws_ses'); $recip = array("ToAddresses"=>array("Quilly@yourownpoet")); $message = array("Subject.Data"=>"My Subject","Body.Text.Data"=>"My Mail body"); $result = $ses->send_email("Quilly@yourownpoet",$recip, $message);

不幸的是,发送带有附件的电子邮件,我需要使用 sendRawEmail 函数代替SEND_EMAIL功能。

Unfortunately, to send an email with attachment, i need to use the sendRawEmail function instead of the send_email function.

我无法找到如何使用此功能,可能有人帮助?

I am unable to find how to use this function, could anybody help?

推荐答案

多次尝试后,我得到的结论是,从code发送电子邮件至亚马逊SES直接是太痛了。

After many tries, I got to the conclusion that sending emails to Amazon SES directly from the code is too much pain.

所以,我并没有改变任何事情,在code和配置我的后缀服务器,而不是。

So I didn't change a thing in the code and configured my postfix server instead.

我按照这个程序:的docs.amazonwebservices/ses/latest/DeveloperGuide/SMTP.MTAs.Postfix.html并使用STARTTLS配置的集成。

I followed this procedure: docs.amazonwebservices/ses/latest/DeveloperGuide/SMTP.MTAs.Postfix.html and configured integration using STARTTLS.

我要问亚马逊控制台SMTP凭据。

I had to ask for SMTP credentials in the Amazon console.

现在它的正常工作,电子邮件是通过亚马逊SES的发送。

Now it's working fine, emails are sent properly through Amazon SES.

更多推荐

使用亚马逊SES附件发送电子邮件

本文发布于:2023-11-23 20:09:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1622736.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:亚马逊   发送电子邮件   附件   SES

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!