:メッセージの本文は、次のようになりますhttp://docs.aws.amazon.com/ses/latest/DeveloperGuide/mailbox-simulator.htmlAmazon SESメールシミュレータがなぜ動作しないのですか?私は、ここに記載されているようにアマゾンSESシミュレータを使用しようとしている(私は、ヘッダーまたは何かが足りないのですか?)
:
MIME-Version: 1.0
Content-Type: multipart/alternative; charset="utf-8";
boundary="===============123456789=="
Content-Transfer-Encoding: base64
Subject: hello test message!
Reply-To: [email protected]_provider.com
To: [email protected]
Return-Path: [email protected]_provider.com
Bounces-to: [email protected]_provider.com
Errors-to: [email protected]_provider.com
From: [email protected]_provider.com
--===============123456789==
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: base64
Ym9keSB3aXRoIG5vbmNlOiAw
--===============123456789==
MIME-Version: 1.0
Content-Type: text/html; charset="utf-8"
Content-Transfer-Encoding: base64
Ym9keSB3aXRoIG5vbmNlOiAw
--===============123456789==--
私が送信していますこれを本体として使用し、boto3インターフェースses_client.send_raw_message
を使用します。
私はこの
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
import re
msg = MIMEMultipart('alternative')
msg.set_charset('utf8')
text_message='Ym9keSB3aXRoIG5vbmNlOiAw'
p = re.compile('<.*?>')
text_message = 'body with nonce: {}'.format(str(nonce))
text = MIMEText(p.sub('', text_message), 'plain', 'utf8')
html = MIMEText(text_message, 'html', 'utf8')
msg.attach(text)
msg.attach(html)
source = '[email protected]_provider.com'
msg['Subject'] = 'hello test message!'
msg['Reply-To'] = source
msg['To'] = to_mail
msg['Return-Path'] = source
msg['Bounces-to'] = source
msg['Errors-to'] = source
だから私はSESを介して電子メールを送信することができますし、それだけで正常に動作ようなもので、このメッセージ本文を生成しています。 [email protected]
にメールを送信することもできます。 私はSNSメッセージングを設定していませんが、私が設定したすべてのヘッダーフィールドを通じて、希望のアドレスでバウンスバックを得ることが期待されました。しかし、私が[email protected]
を使用しても何も起こりません。
これはAmazonが認めヘッダフィールドのリストです: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/header-fields.html
、ここで説明したように、私はまた、電子メールのフィードバック転送を有効にしている: http://docs.aws.amazon.com/ses/latest/DeveloperGuide/notifications-via-email.html
をまた、私はこのロジックを使用して電子メールを送信するために:
amazon_client = boto3.client('ses', 'region', **credentials)
amazon_client.send_raw_email(
Source=from_mail,
Destinations=to_mails,
RawMessage={'Data': body}
)
通知の受信方法を文書化しているページによれば、私はSource
アドレスが指定されていますが、私は設定していますが、電子メールによるフィードバック転送を有効にしています。
アイデアはありますか?
これは投機的なことですが、電子メールのフィードバックメッセージが[検証済みの電子メールアドレス/ドメイン](http://docs.aws.amazon.com/ses/latest/DeveloperGuide/verify- addresses-and-domains.html)? – dorian
私が使用しているすべての電子メールは確認済みです(私は自分自身から自分宛に送信しています) –
次に私は考えていません... AWSフォーラムに問題を投稿することもできます。 – dorian