[英]Best way to send e-mail programmatically from docker container (Spring Boot app) hosted Amazon AWS ECS Cluster?
I was wondering if anyone could advise the "best" (I know that's subjective, but meaning "best" as in least amount of work/steps) to trigger sending an E-mail from Amazon AWS.我想知道是否有人可以建议“最佳”(我知道这是主观的,但意味着“最佳”的工作/步骤量最少)以触发从 Amazon AWS 发送电子邮件。 The Message body with contain dynamic variables/data from my App (Spring boot) so I will have to wire that in somehow, and it should be triggered from within my Application whenever it finishes processing some data, since my app reads .CSV data.消息正文包含来自我的应用程序(Spring 启动)的动态变量/数据,因此我必须以某种方式连接它,并且在完成处理某些数据时应该从我的应用程序内部触发它,因为我的应用程序读取 .CSV 数据。
AWS provides Amazon Simple Email Service (SES) which is: AWS 提供Amazon Simple Email Service (SES) ,它是:
is an email platform that provides an easy , cost-effective way for you to send and receive email using your own email addresses and domains.是一个电子邮件平台,它为您提供了一种简单、经济高效的方式来使用您自己的电子邮件地址和域发送和接收电子邮件。
To use that, you would add SES permissions to your ECS tasks role .要使用它,您需要向ECS 任务角色添加 SES 权限。 This way, you don't need to hard-code any AWS credentials into your application, as they will be automatically obtained by AWS SDK when interacting with SES.这样,您无需将任何 AWS 凭证硬编码到您的应用程序中,因为它们会在与 SES 交互时由 AWS 开发工具包自动获取。
AWS also provides AWS SDK for java . AWS 还提供AWS SDK for java 。 Using the SDK you can send emails using SES as shown in the example Send an email using the AWS SDK for Java .使用开发工具包,您可以使用 SES 发送电子邮件,如示例使用适用于 Java 的 AWS 开发工具包发送电子邮件中所示。
If you want to send an email from a Spring Boot app, then use the Simple Email Service Java V2 API.如果要从 Spring Boot 应用程序发送电子邮件,请使用 Simple Email Service Java V2 API。 There is an AWS Java V2 tutorial that shows how to build a Spring BOOT app that uses various AWS Services to analyze photos located in an Amazon S3 bucket.有一个 AWS Java V2 教程展示了如何构建一个 Spring BOOT 应用程序,该应用程序使用各种 AWS 服务来分析位于 Amazon S3 存储桶中的照片。 This app uses the SES Java V2 API to send a report that contains the details of the Amazon Rekognition service that analyzes the photos.此应用程序使用 SES Java V2 API 发送报告,其中包含分析照片的 Amazon Rekognition 服务的详细信息。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.