Send Email with SMTP Authentication and TLS with VBS CDO

‘ Email is delivered for the following recipients when some codes or types are missing
strMailTo="[email protected]"
’ ccc
strMailCc="[email protected]"

Set oMsg = CreateObject("CDO.Message")
Set oConf = CreateObject("CDO.Configuration")
Set oFlds = oConf.Fields
With oFlds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "au-smtp-outbound-1.mimecast.com"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 587
.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1
.Item("http://schemas.microsoft.com/cdo/configuration/sendusername") = "[email protected]"
.Item("http://schemas.microsoft.com/cdo/configuration/sendpassword") = "xxxxxx"
.Item("http://schemas.microsoft.com/cdo/configuration/sendtls").Value = True

.Update
End With

With oMsg
Set .Configuration = oConf
.From = "[email protected]"
.To = strMailTo
.Cc = strMailCc
.Subject = "Subbect"
.TextBody = "Test"
.AddAttachment msecpath
.Send
End With
Set oMsg = Nothing
Set oConf = Nothing
Set oFlds = Nothing
1 Star2 Stars3 Stars4 Stars5 Stars (1 votes, average: 1.00 out of 5)
Loading...