Set cdoMail = CreateObject("CDO.Message")
Set cdoConfig = CreateObject("CDO.Configuration")
Set Flds = cdoConfig.Fields
With Flds
.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'cdoSendUsingPort
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "localhost"
.Item("http://schemas.microsoft.com/cdo/configuration/smtpconnectiontimeout") = 60
.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
.Update
End With
With cdoMessage
Set .Configuration = cdoConfig
.To = "me@mydomain.com"
.From = "you@yourdomain.com"
.Subject = "test"
.TextBody = "Here is the message"
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
Set Flds = Nothing