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
= any@mail.nl )
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.CreateOb ject("ADODB.Con nection")
objdc.Open("pro vider=Microsoft .Jet.OLEDB.4.0; Data Source
=d:\access\newr es.mdb")
sql="select email from email "
set rs=Server.Creat eObject("ADODB. recordset")
rs.open sql, objdc, 3, 3
Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "mail.tiscali.b e"
.Update
End With
Set cdoMessage = CreateObject("C DO.Message")
for i=1 to rec
email=rs.fields ("email").va lue
With cdoMessage
Set .Configuration = cdoConfig
.From = "aaa@ISP.nl "
.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
= any@mail.nl )
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.CreateOb ject("ADODB.Con nection")
objdc.Open("pro vider=Microsoft .Jet.OLEDB.4.0; Data Source
=d:\access\newr es.mdb")
sql="select email from email "
set rs=Server.Creat eObject("ADODB. recordset")
rs.open sql, objdc, 3, 3
Set cdoConfig = CreateObject("C DO.Configuratio n")
With cdoConfig.Field s
.Item(cdoSendUs ingMethod) = cdoSendUsingPor t
.Item(cdoSMTPSe rver) = "mail.tiscali.b e"
.Update
End With
Set cdoMessage = CreateObject("C DO.Message")
for i=1 to rec
email=rs.fields ("email").va lue
With cdoMessage
Set .Configuration = cdoConfig
.From = "aaa@ISP.nl "
.To = email
.Subject = "test"
.TextBody = "it works!"
.Send
End With
rs.MoveNext
next
end if
Set cdoMessage = Nothing
Set cdoConfig = Nothing
Comment