ã前回、Amazon Simple Email Service(SES)のSMTP機能ã使ã£ã¦ãã¡ã¼ã«ã¯ã©ã¤ã¢ã³ãï¼ThunderBird,iPhoneï¼ããã¡ã¼ã«ãéã£ã¦ã¿ã¾ãããç°¡åã«ã¡ã¼ã«ã¯éãããã®ã®ããããããã®ãæä¸ã§ãã¡ã¼ã«ã¢ã«ã¦ã³ãã§SMTPã ãå¿
è¦ã¨ããäºæ
ãä½ãããã¾ããã
ãããã§æ¬å½ã®ãµã¼ããµã¤ãã®SMTPãµã¼ãã¨ãã¦å©ç¨ãã¦ã¿ããã¨ã«ãã¦ã¿ã¾ããããµã³ãã«ã¨ãã¦ã¯ãRailsã使ã£ã¦ãã¾ãã
Railsã®è¨å®
ãActionMailerã®è¨å®ã§ãSESã®SMTPã®ã¨ã³ããã¤ã³ãï¼URLï¼ã¨ã¦ã¼ã¶åããã¹ã¯ã¼ããè¨å®ããã ãã§ããç°¡åã§ãã
config.action_mailer.raise_delivery_errors = true config.action_mailer.delivery_method = :smtp config.action_mailer.smtp_settings = { :address => 'email-smtp.us-east-1.amazonaws.com', :port => 587, :authentication => :login, :user_name => ENV['AWS_SES_USER'], :password => ENV['AWS_SES_PASS'] }
â»ã½ã¼ã¹ã«ID,Passwordãè¨å®ããã®ãå«ãªã®ã§ãç°å¢å¤æ°ã使ã£ã¦ãã¾ãã
éä¿¡ã®ãã¹ã
ãå·®åºäººãèªè¨¼æ¸ã¿ã®ã¡ã¼ã«ã¢ãã¬ã¹ï¼Verified Sendersï¼ã«ãã¦éãã¨ãä½äºããªãéä¿¡ã§ãã¾ãã
Received: from a194-136.smtp-out.amazonses.com (a194-136.smtp-out.amazonses.com [199.255.194.136])
ã試ãã«æªèªè¨¼ã®ã¢ãã¬ã¹ããéãã¨ãä¸è¨ã®ããã«ã¨ã©ã¼ãåºã¾ãããã®è¾ºãã¯APIããå¼ã³åºããå ´åã¨åãã§ããã
554 Message rejected: Email address is not verified.
ææ³
ãå¾æ¥ããµã¼ããµã¤ãã®ããã°ã©ã ããSESã§ã¡ã¼ã«ãéããã¨ããã¨ãAWS SDKã使ã£ã¦APIãå¼ã³åºããªãã¨ãããªãã®ã§ããããªãã«é¢åãããã£ãã§ããä¸æ¹ã§EC2ä¸ã«SMTPãµã¼ããç«ã¡ä¸ããã¨ãã¡ã¼ã«ã®éä¿¡å¶éã®è§£é¤ä¾é ¼ãGlobal IPã®æ±æããã¦ããªãã®æ³¨æãå¿ è¦ã ã£ããã¨ããããé¢åãããã£ãã§ããä½ããSMTPãµã¼ãã®ãå®ãã¨ããã®ã¯ãä½æ°ã«å¤§å¤ã§ãã
ãSESã®SMTPæ©è½ã使ããã¨ã«ãããä¸å®ã®å¶éããããã®ã®ä¸è¨ã®åé¡ã解決ã§ãã¾ããèªè¨¼æ¸ã¿ã®ã¡ã¼ã«ã¢ãã¬ã¹ããããéããªãåé¡ã¯ãäºåã«Verifyããä»çµã¿ãä½ã£ã¦ããã°è§£æ±ºåºæ¥ãã®ããªãã¨æãã¾ãããã以åã«ãä¸ç¹å®ã®ã¡ã¼ã«ã¢ãã¬ã¹ããéãã¨ããè¦ä»¶ã¯ãã¾ãããã¾ããããä»ã¾ã§SESã®å®æ¦æå ¥ããã¦æ¥ã¾ããã§ããããããããã¯SES SMTPãåºæ¬ã«èãããã¨æãã¾ããæ¯éãã試ãããï¼ï¼
See Also:
Amazon Simple Email Service(SES)のSMTP機能を使ってみる。メールクライアント編
Amazon Simple Email Service(SES)のメール送信テスト用機能を試してみた
AWSで大量メール配信するなら、Amazon SESで決まり
åç
§ï¼
【AWS発表】 Amazon Simple Email Service (SES)がSMTPをサポート