首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从AWS SES发送附件小于10 MB的电子邮件

从AWS SES发送附件小于10 MB的电子邮件
EN

Stack Overflow用户
提问于 2013-07-15 07:08:20
回答 1查看 9.3K关注 0票数 7

我们正在使用AWS从我们的C#应用程序发送电子邮件。我们有一个大小为9.28MB的附件(PDF文件),当我们试图用附件发送电子邮件时,它会抛出以下异常:

代码语言:javascript
运行
复制
System.Xml.XmlException: Root element is missing. at System.Xml.XmlTextReaderImpl.Throw(Exception e) at System.Xml.XmlTextReaderImpl.ParseDocumentContent() at Amazon.Runtime.Internal.Transform.UnmarshallerContext.Read() at Amazon.Runtime.Internal.Transform.ErrorResponseUnmarshaller.Unmarshall(UnmarshallerContext context) at Amazon.SimpleEmail.Model.Transform.SendRawEmailResponseUnmarshaller.UnmarshallException(UnmarshallerContext context, Exception innerException, HttpStatusCode statusCode) at Amazon.Runtime.AmazonWebServiceClient.processWebException[X,Y](String requestName, WebException we, HttpWebRequest webRequest, IResponseUnmarshaller`2 unmarshaller, IRequest`1 request, Int32 retries) at Amazon.Runtime.AmazonWebServiceClient.Invoke[X,Y](IRequest`1 request, AbstractAWSSigner signer, IResponseUnmarshaller`2 unmarshaller) at Amazon.SimpleEmail.AmazonSimpleEmailServiceClient.SendRawEmail(SendRawEmailRequest sendRawEmailRequest) at MyApp.AmazonSESWrapper.SendRawEmail(String awsAccessKey, String awsSecretKey, List`1 to, List`1 cc, List`1 bcc, String senderEmailAddress, String replyToEmailAddress, String subject, String body, String text, String filePath, String exceptionDetails)

但是,当我们将一个7.50MB的word文档作为附件发送时,我们将得到以下异常:

代码语言:javascript
运行
复制
Amazon.SimpleEmail.AmazonSimpleEmailServiceException: Message length is more than 10485760 bytes long: '10788624'. ---> System.Net.WebException: The remote server returned an error: (400) Bad Request. at System.Net.HttpWebRequest.GetResponse() at Amazon.Runtime.AmazonWebServiceClient.Invoke[X,Y](IRequest`1 request, AbstractAWSSigner signer, IResponseUnmarshaller`2 unmarshaller) --- End of inner exception stack trace --- at Amazon.Runtime.AmazonWebServiceClient.processWebException[X,Y](String requestName, WebException we, HttpWebRequest webRequest, IResponseUnmarshaller`2 unmarshaller, IRequest`1 request, Int32 retries) at Amazon.Runtime.AmazonWebServiceClient.Invoke[X,Y](IRequest`1 request, AbstractAWSSigner signer, IResponseUnmarshaller`2 unmarshaller) at Amazon.SimpleEmail.AmazonSimpleEmailServiceClient.SendRawEmail(SendRawEmailRequest sendRawEmailRequest) at 

从“讨论论坛”和“常见问题解答”来看,最大附件大小为10 is,但小于10 is的附件也会出现错误。

https://forums.aws.amazon.com/thread.jspa?messageID=346305

http://aws.amazon.com/ses/faqs/#49

请对此提出建议。

EN

回答 1

Stack Overflow用户

发布于 2014-05-26 12:06:06

还有总的消息大小限制,也就是10米。根据http://aws.amazon.com/ses/faqs/

Amazon将接受10 MB大小的电子邮件。这包括作为消息一部分的任何附件。

所以你必须确保你的请求符合这些限制。

(我个人认为Amazon抛出的bug "XmlException:根元素丢失了“。如果消息大小大大超过了限制的话。这完全是误导。)

票数 8
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17648527

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档