Skip to content

Instantly share code, notes, and snippets.

@kenichiro22
Created March 29, 2012 05:55
Show Gist options
  • Save kenichiro22/2233898 to your computer and use it in GitHub Desktop.
Save kenichiro22/2233898 to your computer and use it in GitHub Desktop.
Amazon SESを使ってメールを送信する
Set message = CreateObject("CDO.Message")
message.From = "[email protected]"
message.To = "[email protected]"
message.Subject = "件名"
message.TextBody = "本文。"
message.TextBodyPart.Charset = "ISO-2022-JP"
Const schemas = "http://schemas.microsoft.com/cdo/configuration/"
message.Configuration.Fields.Item(schemas + "sendusing") = 2
message.Configuration.Fields.Item(schemas + "smtpconnectiontimeout") = 30
message.Configuration.Fields.Item(schemas + "smtpserver") = "email-smtp.us-east-1.amazonaws.com"
message.Configuration.Fields.Item(schemas + "smtpserverport") = "465"
message.Configuration.Fields.Item(schemas + "smtpusessl") = true
message.Configuration.Fields.Item(schemas + "smtpauthenticate") = true
message.Configuration.Fields.Item(schemas + "sendusername") = "Smtp Username"
message.Configuration.Fields.Item(schemas + "sendpassword") = "Smtp Password"
message.Configuration.Fields.Update()
message.Send()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment