Set objEmail = CreateObject("CDO.Message")
objEmail.From = "メールアドレス"
objEmail.To = "メールアドレス"
objEmail.Subject = "CDOのテスト"
objEmail.Textbody = "本文" & vbCrLf & "です"
' objEmail.Htmlbody = "<H1>本文です</H1>"
objEmail.AddAttachment("添付ファイルへのフルパス")
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "SMTPサーバー"
objEmail.Configuration.Fields.Item _
("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
|