problem with CDO

C

Cas

Hi,

I try to send emails with CDO. Those emails are in an Access table.
It works when i put a real emailaddress between quotes in line .To (e.g. .To
= (e-mail address removed) )
When i do like the code here below, i get the error:
error '8004020f'
/defect2.asp, line 55 (line containing the .Send)

Any idea what's the problem and how to solve this?
Thanks
Cas

<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%
set objdc = Server.CreateObject("ADODB.Connection")
objdc.Open("provider=Microsoft.Jet.OLEDB.4.0; Data Source
=d:\access\newres.mdb")
sql="select email from email "
set rs=Server.CreateObject("ADODB.recordset")
rs.open sql, objdc, 3, 3
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(cdoSendUsingMethod) = cdoSendUsingPort
.Item(cdoSMTPServer) = "mail.tiscali.be"
.Update
End With
Set cdoMessage = CreateObject("CDO.Message")

for i=1 to rec
email=rs.fields("email").value
With cdoMessage
Set .Configuration = cdoConfig
.From = "(e-mail address removed)"
.To = email
.Subject = "test"
.TextBody = "it works!"
.Send
End With
rs.MoveNext
next
end if

Set cdoMessage = Nothing
Set cdoConfig = Nothing
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,065
Latest member
OrderGreenAcreCBD

Latest Threads

Top