在 ASP.NET MVC 应用程序中从 Amazon SES 发送电子邮件
我在 amazon ec2 上托管用 .net mvc2 编写的 Web 应用程序。目前使用 gmail smtp 发送电子邮件。由于谷歌的启动电子邮件配额无法每天发送超过 500 封电子邮件。所以决定迁移亚马逊ses。如何将 amazon ses 与 asp.net mvc2 一起使用?配置等怎么样?电子邮件将通过 Gmail 发送吗?因为我们的电子邮件提供商是 gmail。 ETC。
I host my web app which is written in .net mvc2 on amazon ec2. currrently use gmail smtp to send email. beacuse of google for startup email quota cant send more than 500 email a day. So decide to move amazon ses. How can use amazon ses with asp.net mvc2? How about configuration etc? Is email will send via gmail? because our email provider is gmail. etc.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
通过亚马逊发送电子邮件是一个正确的决定。因为当您转移到亚马逊时,您将立即获得每天 2000 封免费电子邮件,这比 googla apps 每天 500 封电子邮件的配额还要多。
逐步操作:
并单击注册 Amazon SES。
您将通过它发送电子邮件。你
需要安装 perl 软件包
您的计算机用于测试电子邮件
特征。
逐步文档。
http://docs.aws.amazon.com/ses/latest /DeveloperGuide/getting-started.html
Codeplex 上有一个 Amazon SES(简单电子邮件服务)C# 包装器,您可以使用此包装器发送电子邮件。
Amazon SES C# 包装器
Send Email via Amazon is a right decision. Because when you move to amazon you will immediately get 2000 email free per day which is greater than googla apps 500 emails quota a day.
Step by Step:
and click Sign Up for Amazon SES.
which you will send email via. You
need perl packages installled on
your computer to test email
features.
Step by step documentation.
http://docs.aws.amazon.com/ses/latest/DeveloperGuide/getting-started.html
There is a Amazon SES (Simple Email Service) C# Wrapper on codeplex you can use this wrapper to send emails.
Amazon SES C# Wrapper
最简单的方法是通过 Nuget 下载 SDK(软件包称为 AWSSDK)或从 Amazon 网站下载 SDK。从他们的网站下载的 sdk 有一个示例项目,向您展示如何调用他们的 API 来发送电子邮件。唯一的配置是插入您的 api 密钥。最棘手的部分是验证您的发送地址(以及任何测试收件人),但它们也是一个 API 调用来发送测试消息。然后,您需要登录并验证这些电子邮件地址。电子邮件将通过亚马逊发送(这就是重点),但发件人电子邮件地址可以是您的 Gmail 地址。
Easiest way is to download the SDK via Nuget (package is called AWSSDK) or download the SDK from Amazon's site. The sdk download from their site has an example project that shows you how to call their API to send email. The only configuration is plugging in your api keys. The trickiest part is verifying your send address (and any test receipients) but their is an API call there too to send the test message. You will then need to log in and verify those email addresses. The email will be sent through Amazon (that is the whole point) but the from email address can be your gmail address.
@gandil 我创建了这个非常简单的代码来发送电子邮件
您可以在此处找到代码 https:// github.com/gianluis90/amazon-send-email
@gandil I created this very simple code to send emails
You can find the code in here https://github.com/gianluis90/amazon-send-email
以下是我发送带有附件的电子邮件的方式
Following is how I sent email with attachment
使用以下命名空间
2.添加到网络配置...
3 .将 AWSEmailSevice 类添加到您的项目中,该类将允许通过 AWS ses 发送邮件...
// 调用此方法发送您的电子邮件
use following name-spaces
2 . Add to web config...
3 . Add a AWSEmailSevice class to your project that will allow to send mail via AWS ses...
// Call this method to send your email