• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 367
  • Last Modified:

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.NotesSession")

Set db = s.GETDATABASE(server,database)


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("Body")
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
  • 4
  • 4
1 Solution
alcappsAuthor Commented:
Please Send the answer to albert.capps@firstunion.com That way I can read it during the Day... thanks..
I dont see anything wrong with ur code...u r not able to connect to the server that holds your database?
alcappsAuthor Commented:
Yes I can't connect or open the database .. when I get to the line.. GetDatabase..
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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")
alcappsAuthor Commented:
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..


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.
alcappsAuthor Commented:
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..

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)
u can start up notes normally when u create a new session object. u must make sure that notes32.tlb is a registered file, which is in your case, u shouldnt have problems instantianting a notes session class. u dont have to specify the full path for the file name, coz the notes session object gets the environment variables from the notes.ini which is usually residing in your windows directory. otherwise u must specify a path for it as gunsen suggested. and for the password prompt, there is no way around it.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 4
  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now