Hi
I’m trying to send emails from an ASP page using a Domino COM object.
I can instantiate the COM object OK, but the script fails with a “Database open failed”/NotesDbDirectory error ‘80040fcb’ error as soon as I try to open the mail database with Set db = dir.OpenMailDatabase.
The paths set in notes.ini appear to be correct.
I had this script working perfectly prior to our upgrade to Domino server 6.02.
Any suggestions would be appreciated.
Cheers
Sam
The code I’m trying to run is as follows:
<%
Option Explicit
dim sess, dir, db, doc, mailServer
dim astrTo, rtItem, message, message_sent
dim mailDB
Set sess = CreateObject(“Lotus.NotesSession”)
sess.Initialize(“password”)
response.write(“…COM object instantiation and initialise OK”)
mailServer = sess.GetEnvironmentString(“MailServer”, True)
response.write("
…Mail Server is: " & mailServer)
set dir = sess.GetDbDirectory(mailServer)
response.write("
…DB Dir is: " & sess.GetDbDirectory(mailServer))
mailDB = sess.GetEnvironmentString(“MailFile”, True)
response.write("
…MailFile in ini is: " & mailDB)
Set db = dir.OpenMailDatabase
response.write(“
…Mail DB open OK”)
If db.IsOpen then
Set doc = db.CreateDocument
response.write(“
…The DB object has been used to create a Document object”)
Call doc.ReplaceItemValue(“Form”, “Memo”)
'To : (for more than one recipient, use an array of strings
ReDim astrTo(0)
astrTo(0) = “webmanager@man.mbs.ac.uk”
'astrTo(1) = “first.last@example.com”
Call doc.ReplaceItemValue(“SendTo”, astrTo)
’ CC:
'ReDim strCC(0)
'strCC(0) = “webmanager@man.mbs.ac.uk”
'call objDoc.ReplaceItemValue(“CopyTo”, strCC)
’ BCC:
'call objDoc.ReplaceItemValue(“BlindCopyTo”, strBCC)
’ Subject:
Call doc.ReplaceItemValue(“Subject”, "404 Missing Page " & Now)
Set rtItem = doc.CreateRichTextItem( “Body” )
’ Body
message = “Will it ever work…?”
Call rtItem.AppendText(message & vbCRLF & vbCRLF)
’ Attachments
’ Call objRTItem.EmbedObject( 1454, “”, “drive:\directory\file.ext”)’ Must specify directory
doc.SaveMessageOnSend = False ’ Change to True to save message in mailfile.nsf
Call doc.Send( False )
message_sent = true
else
message_sent = false
end if
%>