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
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