benlinkknilneb
Programmer
Hi all,
I've been working on an ASP helpdesk ticket system I found for free on the web. I had to make some modifications to it because our company uses Notes, and I wanted to be able to email notifications to users and techs. I can't set up a virtual SMTP server and do it the easy way, of course... Corporate won't allow it. So I started writing code to open a Notes Session from the web page. I've installed Notes on the web server and I got the script to work properly when it's by itself... but when I add it to my ASP page, it craps out the first time with ASP 0115 "script can't continue", and then the 2nd time it tells me it's "out of memory" on the line where I create the Notes Session. Here's the code from the script, with the offending line highlighted:
Dim objSession
Dim objDir
Dim objDB
Dim objDoc
Dim objRTItem
Dim strMailServer
Dim richStyle
Dim oFS
Set oFS = wscript.createobject("Scripting.filesystemobject")
[COLOR=black yellow]Set objSession = CreateObject("Lotus.NotesSession")[/color]
Call objSession.Initialize({mypassword})
strMailServer = bjSession.GetEnvironmentString("MailServer", True)
Set objDir = objSession.GetDbDirectory(strMailServer)
Set objDB = objDir.OpenMailDatabase
If objDB.IsOpen Then
Set objDoc = objDB.CreateDocument
Call objDoc.ReplaceItemValue("Form", "Memo")
Call objDoc.ReplaceItemValue("SendTo", strToAddr)
Call objDoc.ReplaceItemValue("Subject", strSubject)
Call objDoc.ReplaceItemValue("Body", strBody)
objDoc.SaveMessageOnSend = True
Call objDoc.Send( False )
End If
Set objSession = Nothing
Set oFS = Nothing
set args = Nothing
Set objDB = Nothing
Set objDoc = Nothing
As I said, I took this code out of the web page and put it in a regular script, and it ran fine. It's just when it runs from the web page that it messes up.
Ben
The ships hung in the sky in much the same way that bricks don't. - Douglas Adams
I've been working on an ASP helpdesk ticket system I found for free on the web. I had to make some modifications to it because our company uses Notes, and I wanted to be able to email notifications to users and techs. I can't set up a virtual SMTP server and do it the easy way, of course... Corporate won't allow it. So I started writing code to open a Notes Session from the web page. I've installed Notes on the web server and I got the script to work properly when it's by itself... but when I add it to my ASP page, it craps out the first time with ASP 0115 "script can't continue", and then the 2nd time it tells me it's "out of memory" on the line where I create the Notes Session. Here's the code from the script, with the offending line highlighted:
Dim objSession
Dim objDir
Dim objDB
Dim objDoc
Dim objRTItem
Dim strMailServer
Dim richStyle
Dim oFS
Set oFS = wscript.createobject("Scripting.filesystemobject")
[COLOR=black yellow]Set objSession = CreateObject("Lotus.NotesSession")[/color]
Call objSession.Initialize({mypassword})
strMailServer = bjSession.GetEnvironmentString("MailServer", True)
Set objDir = objSession.GetDbDirectory(strMailServer)
Set objDB = objDir.OpenMailDatabase
If objDB.IsOpen Then
Set objDoc = objDB.CreateDocument
Call objDoc.ReplaceItemValue("Form", "Memo")
Call objDoc.ReplaceItemValue("SendTo", strToAddr)
Call objDoc.ReplaceItemValue("Subject", strSubject)
Call objDoc.ReplaceItemValue("Body", strBody)
objDoc.SaveMessageOnSend = True
Call objDoc.Send( False )
End If
Set objSession = Nothing
Set oFS = Nothing
set args = Nothing
Set objDB = Nothing
Set objDoc = Nothing
As I said, I took this code out of the web page and put it in a regular script, and it ran fine. It's just when it runs from the web page that it messes up.
Ben
The ships hung in the sky in much the same way that bricks don't. - Douglas Adams