Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CDO and Lots of Emails

Status
Not open for further replies.

timfoster

Programmer
Dec 19, 2002
110
GB
Hi Folks,

We've developed a website that needs to be able to send regular mailings. Our complete mailing list is 1.4 million unique users and even though we're using a VPS the hosting company (understandably) don't want us to send mailings out to 1.4 million email addresses. The addresses are all opt-in and verified as of March this year, so I'm not worried about spam as it's not spam.

What we've agreed with our hosts is that we'll send smaller targetted mailings in blocks of no more than 5000 a day.

The problem I have is that I need to make the mailings as fast as possible. At present, I'm reading the mailing text from the db. I then loop the list of recipients, replacing the mailing text with the personalised text, and sending the mails out via CDO. This works (to a degree) but is very slow.

Anyone got any ideas how I can speed it up? Teh bottleneck seems to be Send method of the the CDO object.

Thanks for your help.
 
Hi BigRed,

Not much to show really.

Do Until l.EOF
If IsNull(l("EmailAddress")) = False Then
mBody = Replace(mBody, "{$EmailAddress$}", l("EmailAddress"))
Set objMessage = CreateObject("cdo.message")
Set objConfig = CreateObject("cdo.configuration")
Set Flds = objConfig.Fields
Flds.Item(" = 2
Flds.Item(" = "smtpserver"
Flds.update

objMessage.HTMLBody = mHead & mBody
Set objMessage.Configuration = objConfig
objMessage.To = l("EmailAddress") & " (" & l("FirstName") & " " & l("LastName") & ")"
objMessage.From = "no.reply@xxx.com (xxx)"
objMessage.Subject = mSubject

objMessage.Fields.Update
objMessage.Send

Set objMessage = Nothing
Set objConfig = Nothing
Set Flds = Nothing
l.MoveNext
Loop

The speed issue is a real problem, so any advice would be appreciated.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top