Logo

dev-resources.site

for different kinds of informations.

CLIでメールを送信する

Published at
11/14/2023
Categories
ses
cli
Author
matyuda
Categories
2 categories in total
ses
open
cli
open
Author
7 person written this
matyuda
open
CLIでメールを送信する

aws ses send-email --from "送信元アドレス" --to "送信先アドレス" --subject "件名" --text "本文"

ヘッダを変更したい場合などにおいては、aws ses send-raw-emailコマンドを利用する必要があるが、Base64でエンコードしないと Invalid base64 で怒られたりするので少しテクニックが必要となる。

公式ドキュメントにもサンプルが掲載されていなかったので、サンプルを作成してみた。

message.txtとして以下のようなものを用意した上で

{
"Data": "From: (送信元アドレス)\nTo: (Delivered-Toヘッダとしての送信先アドレス)\nSubject: (件名)\n\n(本文)"
}
Enter fullscreen mode Exit fullscreen mode

以下の通りコマンドを実行すれば良い。
なお、message.txtに送信元アドレスを追加しない場合には、 --source "送信元アドレス" を追加する必要がある。(An error occurred (InvalidParameterValue) when calling the SendRawEmail operation: Missing required header 'From'.がエラーが返される)

aws ses send-raw-email --destinations "送信先アドレス1" "送信先アドレス2" --cli-binary-format raw-in-base64-out --raw-message file://message.txt

ses Article's
30 articles in total
Favicon
Amazon SES Unwrapped: Key Lessons & Testing Tips for Building Robust Email Systems
Favicon
Setting Up and Handling Email Aliases in AWS SES
Favicon
AWS workshop #2: Leveraging Amazon Bedrock to enhance customer service with AI-powered Automated Email Response
Favicon
Sending Emails with Spring Boot, AWS SES, and Serverless Lambda for Scalable Solutions
Favicon
Building smarter RSS feeds for my newsletter subscriptions with SES and Bedrock
Favicon
Unleashing the Power of Python Lambda Functions with Terraform for Email Automation via AWS SES
Favicon
Differences Between Amazon SES, Amazon SNS, and Amazon Pinpoint
Favicon
Getting production access to AWS SES (2024)
Favicon
Implementing a Mail Delivery Switch in Python for Local and AWS Environments Using Amazon SES
Favicon
Security Protocol to connect AWS SES
Favicon
Trigger a Typescript AWS Lambda on Receiving an Email with SES
Favicon
Click Click… Configuring Custom Domain SES Tracking with AWS CDK
Favicon
How to setup SES Email templates [2024 Guide]
Favicon
Why I Built the SES Easy Mailer Node Module
Favicon
Configurando Amazon SES para envio de e-mail
Favicon
Monitoramento de Eventos no AWS SES com Filtros no CloudWatch Logs
Favicon
Mail-in-a-Box (Relay AWS SES)
Favicon
Streamline Email Sending with AWS SES, Lambda, and S3 Integration
Favicon
AWS Lambda with CloudWatch for Seamless EC2 State Change Notifications through SES.
Favicon
Send mail by SES CLI
Favicon
CLIでメールを送信する
Favicon
Sending Email with Amazon SES on NodeJS
Favicon
Integrating AWS Simple Email Service (SES) with Laravel: A Comprehensive Guide
Favicon
The Differences In Sending Email Actions Between SES Version 1 and Version 2 APIs
Favicon
Unlocking Real-Time Insights: Harnessing Lambda and SES to Supercharge S3 Bucket Alerts
Favicon
Tracking Email Activity from AWS Simple Email Service (SES)
Favicon
Streamline Email Sending with AWS SES, Lambda, and S3 Integration
Favicon
Setup WordPress using AWS Lightsail
Favicon
Getting Started with SES: Required Permissions to Send Emails
Favicon
AWS SES - Core Concepts

Featured ones: