F
Fox
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2
Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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("fromWho") = 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 = "(e-mail address removed)"
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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
.item(Response.Buffer) = False
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
'The HTML Body is built here
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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.ScriptTimeout = 6000
Set objEmail= Server.CreateObject("ADODB.Connection")
objEmail.Open "DSN=Tournaments;",2
Set CompetitorEmail = Server.CreateObject("ADODB.Recordset")
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("fromWho") = 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 = "(e-mail address removed)"
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 cdoSendUsingPickup = 2
Set objCDO = Server.CreateObject("CDO.Message")
Set iConf = Server.CreateObject("CDO.Configuration")
Set Flds = iConf.Fields
With Flds
.Item(cdoSendUsingMethod) = cdoSendUsingPickup
.Item("smtpserverpickupdirectory")= "c:\Inetpub\mailroot\pickup"
.Item(cdoFlushBuffersOnWrite) = true
.item(Response.Buffer) = False
.Item(cdoSMTPServer) = "mailforward.connexions.net"
.Update
'The HTML Body is built here
End With
Set objCDO.Configuration = iConf
objCDO.From = fromWho
objCDO.To = toWho
objCDO.Subject = Subject
objCDO.HTMLbody = strHTML
'objCDO.AddAttachment
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