I merged and modified these script which work perfectly fine
as long as I use server.execute to access the VBS
part (which is itself in another ASP file). When these
I use a session variable to pass an email address from
the database. I have had timeout problems
and buffer problems and as I understand it, maybe
a problem with changing the session variable too many
times in one session. So I tried putting the two scripts
on one page. When I do I get the error
Microsoft VBScript compilation error '800a03ea'
Syntax error
/tournament-services/fbba/editor/cdo_setmail.asp , line 24
SUB sendmail( fromWho, toWho, Subject, Body )
Note that this is a large email list for a World Karate
Tournament and is not a spam list. It has about 20,000
recipients and I have never done anything like this
hence the problems.
How can I get these to work together on the same page?
Here is the first script with the server.execute commented out
since I do not want to use it if I can get this all on one page.
I am hoping that doing that will end the other error problems.
The first sript will have the second replace the server.execute.
FIRST SCRIPT BEGIN:
Server.ScriptTi meout = 6000
Set objEmail= Server.CreateOb ject("ADODB.Con nection")
objEmail.Open "DSN=Tournament s;",2
Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
Email;"
CompetitorEmail .Open sqltext, objEmail
Do While not CompetitorEmail .EOF
If not address = CompetitorEmail ("Email") then
'assign who to send to
session("fromWh o") = CompetitorEmail ("email")
'cycle through mail sender
'server.execute ("CDO-vernon.asp")
'the second script was placed here
end if
address = CompetitorEmail ("Email")
CompetitorEmail .MoveNext
Loop
CompetitorEmail .close
Set CompetitorEmail = Nothing
END FIRST SCRIPT
SECOND SCRIPT STARTS
'I will remove the building of the HTML body.
toWho = "dennis@connexi ons.net"
Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
Invitational - Vernon Jones Jr."
'it is this SUB that causes the syntax alert
SUB sendmail( fromWho, toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPic kup = 2
Set objCDO = Server.CreateOb ject("CDO.Messa ge")
Set iConf = Server.CreateOb ject("CDO.Confi guration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
.Item("smtpserv erpickupdirecto ry")= "c:\Inetpub\mai lroot\pickup"
.Item(cdoFlushB uffersOnWrite) = true
.item(Response. Buffer) = False
.Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
.Update
'The HTML Body is built here
End With
Set objCDO.Configur ation = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAtta chment
objCDO.Send
END SUB
If toWho <> "" THEN
sendMail fromWho, toWho, Subject, Body
END IF
'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
END SECOND SCRIPT
As mentioned above, when I put this second
script into the middle of the first, the SUB errors
as incorrect syntax. I am really over my head here
and do not know what can be done to rectify this.
Thanks for any pointers,
Fox
as long as I use server.execute to access the VBS
part (which is itself in another ASP file). When these
I use a session variable to pass an email address from
the database. I have had timeout problems
and buffer problems and as I understand it, maybe
a problem with changing the session variable too many
times in one session. So I tried putting the two scripts
on one page. When I do I get the error
Microsoft VBScript compilation error '800a03ea'
Syntax error
/tournament-services/fbba/editor/cdo_setmail.asp , line 24
SUB sendmail( fromWho, toWho, Subject, Body )
Note that this is a large email list for a World Karate
Tournament and is not a spam list. It has about 20,000
recipients and I have never done anything like this
hence the problems.
How can I get these to work together on the same page?
Here is the first script with the server.execute commented out
since I do not want to use it if I can get this all on one page.
I am hoping that doing that will end the other error problems.
The first sript will have the second replace the server.execute.
FIRST SCRIPT BEGIN:
Server.ScriptTi meout = 6000
Set objEmail= Server.CreateOb ject("ADODB.Con nection")
objEmail.Open "DSN=Tournament s;",2
Set CompetitorEmail = Server.CreateOb ject("ADODB.Rec ordset")
sqltext = "SELECT Email FROM Vernon_email Where Email like '%@%' Order By
Email;"
CompetitorEmail .Open sqltext, objEmail
Do While not CompetitorEmail .EOF
If not address = CompetitorEmail ("Email") then
'assign who to send to
session("fromWh o") = CompetitorEmail ("email")
'cycle through mail sender
'server.execute ("CDO-vernon.asp")
'the second script was placed here
end if
address = CompetitorEmail ("Email")
CompetitorEmail .MoveNext
Loop
CompetitorEmail .close
Set CompetitorEmail = Nothing
END FIRST SCRIPT
SECOND SCRIPT STARTS
'I will remove the building of the HTML body.
toWho = "dennis@connexi ons.net"
Subject = "Karate Tounament NASKA/FST/FBBA: OSU! The SuperStar
Invitational - Vernon Jones Jr."
'it is this SUB that causes the syntax alert
SUB sendmail( fromWho, toWho, Subject, Body )
Dim objCDO
Dim iConf
Dim Flds
Const cdoSendUsingPic kup = 2
Set objCDO = Server.CreateOb ject("CDO.Messa ge")
Set iConf = Server.CreateOb ject("CDO.Confi guration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUs ingMethod) = cdoSendUsingPic kup
.Item("smtpserv erpickupdirecto ry")= "c:\Inetpub\mai lroot\pickup"
.Item(cdoFlushB uffersOnWrite) = true
.item(Response. Buffer) = False
.Item(cdoSMTPSe rver) = "mailforward.co nnexions.net"
.Update
'The HTML Body is built here
End With
Set objCDO.Configur ation = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAtta chment
objCDO.Send
END SUB
If toWho <> "" THEN
sendMail fromWho, toWho, Subject, Body
END IF
'Cleanup
Set ObjCDO = Nothing
Set iConf = Nothing
Set Flds = Nothing
END SECOND SCRIPT
As mentioned above, when I put this second
script into the middle of the first, the SUB errors
as incorrect syntax. I am really over my head here
and do not know what can be done to rectify this.
Thanks for any pointers,
Fox
Comment