alcapps
asked on
Send a Mail Item Using Access through Lotus Notes
I need to send a Mail Message through Lotus Notes from MS. Access 97. I have found a Lotus Automation but have not figured out how to send it through yet.. Not connecting to the Database and server.. for starters..
here is some code I testing..
Public Sub Test()
Dim s As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim nt As Object
' start up Lotus Notes and get object handle
Set s = CreateObject("Notes.NotesS ession")
'getDatabase
Set db = s.GETDATABASE(server,datab ase)
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "mailaddress.." 'Enter the mail address here
doc.Subject = "This is a test message" 'Enter your subject matter here
' this will build the text part of your mail message
Set rtitem = doc.CREATERICHTEXTITEM("Bo dy")
Call rtitem.APPENDTEXT("The body of the message goes here!")
Call rtitem.ADDNEWLINE(1)
Call doc.Send(False) 'Make sure this parameter stays false
' set all object handles to nothing to release memory
Set doc = Nothing
Set db = Nothing
Set s = Nothing
End Sub
here is some code I testing..
Public Sub Test()
Dim s As Object
Dim db As Object
Dim doc As Object
Dim rtitem As Object
Dim nt As Object
' start up Lotus Notes and get object handle
Set s = CreateObject("Notes.NotesS
'getDatabase
Set db = s.GETDATABASE(server,datab
Set doc = db.CREATEDOCUMENT
doc.Form = "Memo"
doc.SendTo = "mailaddress.." 'Enter the mail address here
doc.Subject = "This is a test message" 'Enter your subject matter here
' this will build the text part of your mail message
Set rtitem = doc.CREATERICHTEXTITEM("Bo
Call rtitem.APPENDTEXT("The body of the message goes here!")
Call rtitem.ADDNEWLINE(1)
Call doc.Send(False) 'Make sure this parameter stays false
' set all object handles to nothing to release memory
Set doc = Nothing
Set db = Nothing
Set s = Nothing
End Sub
I dont see anything wrong with ur code...u r not able to connect to the server that holds your database?
ASKER
ghassan99
Yes I can't connect or open the database .. when I get to the line.. GetDatabase..
Yes I can't connect or open the database .. when I get to the line.. GetDatabase..
start notes, then try your code...then try connecting to a database on the same server which ur current notes client is conntected to...say getdatabase("","names.nsf" )
ASKER
ghassan99..
I got it to send a message while Lotus Notes.. was up .. I still need to do the begining to this to make it work..
Bring up Lotus notes.. Get access to the mail portion by passing the Password and Sending the message and shuting down Lotus notes... full circle..
So If I bring up Lotus.. and have signed in I now can send a message..
Could you help me with the begining part..??
I put in "C:\notes\data\names.nsf" and it worked fine..
AL
I got it to send a message while Lotus Notes.. was up .. I still need to do the begining to this to make it work..
Bring up Lotus notes.. Get access to the mail portion by passing the Password and Sending the message and shuting down Lotus notes... full circle..
So If I bring up Lotus.. and have signed in I now can send a message..
Could you help me with the begining part..??
I put in "C:\notes\data\names.nsf" and it worked fine..
AL
I'm sorry there is no way to do this, like supplying the password...u cant bypass the password prompt, as to bring up notes, u can do that in R5. If u have an R5 client then u can with one click start notes, but then u will have to supply a password. or if u dont want to use the password u have to do a clear password, which is also a security breach.
ASKER
I belive we are using R4.6, How do I get lotus to come up with just the password prompt then.. Thanks for your help so far..
Al
Al
Make sure that you have PATH set to program directory. A valid notes ini-file should also be in your path.This holds the mail-server and point to correct id-file.
ie: PATH=%PATH%;c:\notes\uk46; c:\ini\;
(in this case my ini-file is located at c:\ini\notes.ini - in most cases it's located below c:\windows)
ie: PATH=%PATH%;c:\notes\uk46;
(in this case my ini-file is located at c:\ini\notes.ini - in most cases it's located below c:\windows)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER