Set oMsg = CreateObject("CDO.Message")
oMsg.Fields.Item("urn:schemas:mailheader:X-Mailer") = "Your Mailer Name"
oMsg.Fields.Update()
oMsg.From = "from@mail.address.somewhere"
oMsg.To = "to@mail.addresss.somewhere"
oMsg.Subject = "Your Subject"oMsg.TextBody = "Your Message"
oMsg.TextBodyPart.Charset = "ISO-2022-JP"
schemas = "http://schemas.microsoft.com/cdo/configuration/"
oMsg.Configuration.Fields.Item (schemas & "sendusing") = 2
oMsg.Configuration.Fields.Item (schemas & "smtpserver") = "smtp.gmail.com"
oMsg.Configuration.Fields.Item (schemas & "smtpserverport") = 465
oMsg.Configuration.Fields.Item (schemas & "smtpauthenticate") = true
oMsg.Configuration.Fields.Item (schemas & "sendusername") = "from@mail.address.somewhere"
oMsg.Configuration.Fields.Item (schemas & "sendpassword") = "YourGmailPassword"oMsg.Configuration.Fields.Item (schemas & "smtpusessl") = true
oMsg.Configuration.Fields.Update
oMsg.Send
Set oMsg = Nothing
@IT:Windows TIPS -- Tips:Windows標準機能とWSHを使ってメールを送信する: "CDO"