Hi all,
I want to send an email to people in the database field list. How to accomplsh that? My code is straight forward and also found an error saying: "the transport failed to connect to the server". Please help.

Private Sub From_Load()
    Call SendEmail
End Sub
Public Function SendEmail()
Set objEmail = CreateObject("CDO.Message")
objEmail.From = "..."
objEmail.To = "..."
objEmail.Subject = "Testing"
objEmail.TextBody = "Test - Send Email"
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "..."
objEmail.Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25
objEmail.Configuration.Fields.Update
objEmail.Send
End Function

Recommended Answers

All 3 Replies

error on which line ?

The error is at line 11 (objEmail.Send).

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.