Skip to content

Instantly share code, notes, and snippets.

@utahta
Created June 19, 2013 07:00
Show Gist options
  • Select an option

  • Save utahta/5812181 to your computer and use it in GitHub Desktop.

Select an option

Save utahta/5812181 to your computer and use it in GitHub Desktop.
VBSメール送信
Set objMail = CreateObject("CDO.Message")
objMail.From = "hoge@gmail.com"
objMail.To = "foo@gmail.com"
objMail.Subject = "テスト"
objMail.TextBody = "本文"
strConfigurationField ="http://schemas.microsoft.com/cdo/configuration/"
With objMail.Configuration.Fields
.Item(strConfigurationField & "sendusing") = 2
.Item(strConfigurationField & "smtpserver") = "smtp.googlemail.com"
.Item(strConfigurationField & "smtpserverport") = 465
.Item(strConfigurationField & "smtpusessl") = True
.Item(strConfigurationField & "smtpauthenticate") = 1
.Item(strConfigurationField & "sendusername") = "hogehoge@gmail.com"
.Item(strConfigurationField & "sendpassword") = "password"
.Item(strConfigurationField & "smtpconnectiontimeout") = 60
.Update
end With
objMail.Send
Set objMail = Nothing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment