Not familiar at all with Lotus notes. I am writting code to create email messages from MS Access to send out via Lotus Notes with attachments. Everything works fine except that the client wants to send the emails from an email box other than their own. The key portion of the code is as follows
Dim mailbox As Object
Dim session As Object
Dim db As Object
Set session = CreateObject("notes.notessession")
Set db = session.GetDatabase("", "dog")
'OPEN THE MAIL DATABASE
If db.IsOpen = True Then
'CREATE THE NEW DOCUMENT
Set MailDoc = db.CreateDocument
Call MailDoc.AppendItemValue("Subject", sSubject)
'SET DOCUMENT FORMAT TO MEMO
Call MailDoc.AppendItemValue("Form", "Memo")
Call MailDoc.AppendItemValue("SendTo", sRecipient)
'CREATE MEMO BODY
Set rtItem = MailDoc.CreateRichTextItem("Body")
Set rtStyle = session.CreateRichTextStyle
'Save as draft instead of send
Call MailDoc.Save(True, True)
The problem seems to be with the
GetDatabase("", "gmcc") line of code.
if I use Getdatabase("","") it creates the email just fine in their default email draft folder.
If I use GetDatabase("", "Dog") it created the email just fine in the email box called Dog on their local machine.
My problem is that regardless of what I put in the first parameter of GetDatabase as the server name, it ignores it and sends the email from the default email box.
How do I find the value to put in the first parameter so that it used the server not the local database? I have a lot of programming experience, but nearly no Lotus notes experience. Is there a way using some vba code added to what i have already above to get it to tell me the server name or is there some thing I can look at in Notes iteslf to ge the value. I have tried going to the file preferences and the mailbox database properties dialogs and tried using all the values there to no avail. I am guessing there is an easy solution if you know how to do it.