Dim Cdo2Configuration As cdo.Configuration
Dim Cdo2Message As cdo.Message
Dim Cdo2Fields As ADODB.Fields
Set Cdo2Configuration = New cdo.Configuration
Set Cdo2Fields = Cdo2Configuration.Fields
With Cdo2Fields
.Item(cdoSMTPServer) = "Exchange_Server_Name"
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPConnectionTimeout) = 15
.Update ' Important
End With
' Create a new message.
Set Cdo2Message = New cdo.Message
' Set the message's configuration.
Set Cdo2Message.Configuration = Cdo2Configuration
' Set the message content.
Cdo2Message.Subject = sSubject
Cdo2Message.TextBody = sBody
Cdo2Message.HTMLBody = sHtmlBody
' Address the message.
Cdo2Message.Sender = sSender
Cdo2Message.From = sSender
Cdo2Message.To = sTo
' Send the message.
Cdo2Message.Send
Set Cdo2Message = Nothing
Set Cdo2Configuration = Nothing
Set Cdo2Fields = Nothing
Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.
When asked, what has been your best career decision?
Deciding to stick with EE.
Being involved with EE helped me to grow personally and professionally.
Connect with Certified Experts to gain insight and support on specific technology challenges including:
We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE