B
Brent Patroch
Hello,
Novice here, I am doing bulk emails using CDO, connection to a smtp
server at another location. I am trying to streamline my script, or
through it out and start over to make it faster.
I know that I am doing something wrong and that messages should be
sending much faster. Any help appreciated:
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod)= cdoSendUsingPort
.Item(cdoSMTPServer) = "blah.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "(e-mail address removed)"
.Item(cdoSendPassword) = "blah"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
' Open database here
objRS.Open SQLString, objConn,2,2
I = 0
With objMessage
.From = "Blah Mailer <[email protected]>"
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
Do while not objRS.EOF
.To = objRS("Name") & "<" & objRS("Email") & ">"
.send
objRS.MoveNext
I = I + 1
Loop
End With
objRS.Close
objConn.Close
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing
Novice here, I am doing bulk emails using CDO, connection to a smtp
server at another location. I am trying to streamline my script, or
through it out and start over to make it faster.
I know that I am doing something wrong and that messages should be
sending much faster. Any help appreciated:
Set objConfig = Server.CreateObject("CDO.Configuration")
Set Fields = objConfig.Fields
With Fields
.Item(cdoSendUsingMethod)= cdoSendUsingPort
.Item(cdoSMTPServer) = "blah.com"
.Item(cdoSMTPServerPort) = 25
.Item(cdoSMTPConnectionTimeout) = 10
.Item(cdoSMTPAuthenticate) = cdoBasic
.Item(cdoSendUserName) = "(e-mail address removed)"
.Item(cdoSendPassword) = "blah"
.Update
End With
Set objMessage = Server.CreateObject("CDO.Message")
Set objMessage.Configuration = objConfig
' Open database here
objRS.Open SQLString, objConn,2,2
I = 0
With objMessage
.From = "Blah Mailer <[email protected]>"
.Subject = Request.Form("Subject")
.TextBody = Request.Form("Body")
Do while not objRS.EOF
.To = objRS("Name") & "<" & objRS("Email") & ">"
.send
objRS.MoveNext
I = I + 1
Loop
End With
objRS.Close
objConn.Close
Set Fields = Nothing
Set objMessage = Nothing
Set objConfig = Nothing