LoginSignup
3
2

More than 1 year has passed since last update.

Amazon SESでバージニア・リージョン以外からメール送信

Last updated at Posted at 2014-11-18

はじめに

Amazon SES は, サーバの構築なしで手軽にメール送信できるサービスである.
下記のリージョンで利用できる. (2014/11時点)

  • 米国東部 (バージニア北部)
  • 米国西部 (オレゴン)
  • 欧州 (アイルランド)

メール送信

Amazon Simple Email Service Scriptsを使えば, EC2上からコマンドでメール送信できる.
バージニア・リージョンから送信する場合, コマンドは下記のとおり.

$ ./ses-send-email.pl -s $title -f $from_adress $to_adress < $message_file

または,

$ perl -I/path/to/ses /path/to/ses/ses-send-email.pl -s $title -f $from_adress $to_adress < $message_file

しかし, バージニア・リージョン以外から送信する場合は,
下記のように-eオプションでエンドポイントURLを指定する必要があるので,
注意 (下記はリージョンがオレゴンの場合).

$ ./ses-send-email.pl -e 'https://email.us-west-2.amazonaws.com/' -s $title -f $from_adress $to_adress < $message_file

実は, -eオプションなしのときは, デフォルトが
バージニアのエンドポイントURL (https://email.us-east-1.amazonaws.com/)
となっていただけである (コマンドのヘルプに記載あり).

SESが使うサーバはリージョン毎に異なるので, このように適切なエンドポイントを指定する必要がある.
なお, 各リージョンのエンドポイントURLはRegions and Amazon SESに載っている.

参考

3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2