Access and email using Lotus Notes Server

  • Thread starter Thread starter egeriicw
  • Start date Start date
E

egeriicw

Guest
I am looking to be able to send email from an Access Database using Lotus Notes. Does anyone have any resources or knowledge of how to do this?

Or if anyone knows of a better way to send email via access, it would be greatly appreciated. I would like to stear away from sending an attachment, and also the email is to be updated for each individual record within the database. I have the code developed to update the messages (pretty easy), but I am not sure as to what objects or methods to use for actually sending the email.

Thanks...
 
Last edited:
Lnotes email

You can use Access to send an email trough LNotes. Here is some code I picked up from this forum.

Dim s As Object
Dim db As Object
Dim doc As Object
Dim rtItem As Object
Dim Server As String, Database As String
Dim strError As String

Set s = CreateObject("Notes.notesSession")
Server = s.GETENVIRONMENTSTRING("MailServer", True)
Database = s.GETENVIRONMENTSTRING("MailFile", True)
Set db = s.GETDATABASE(Server, Database)

On Error GoTo ErrorLogon
'see if user is logged on
Set doc = db.CREATEDOCUMENT
On Error GoTo 0

doc.Form = "Memo"
doc.importance = "1" '(Where 1=Urgent, 2= Normal, 3= FYI)

'Send an e-mail to
doc.SENDTO = "emailaddress" or lookup from the db somewhere
doc.RETURNRECEIPT = "1"
doc.Subject = "Subject of email"

Set rtItem = doc.CREATERICHTEXTITEM("Body")
Call rtItem.APPENDTEXT("Type what ever you want")
Call rtItem.ADDNEWLINE(1)
Call rtItem.APPENDTEXT("Type another line")
Call rtItem.ADDNEWLINE(1)


Call doc.Send(False)


Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing

ErrorLogon:
If Err.Number = 7063 Then
msgbox " You must first logon to Lotus Notes"
Set doc = Nothing
Set db = Nothing
Set s = Nothing
Set rtItem = Nothing
End If

To add an attachment just add
Call rtItem.EMBEDOBJECT(1454, "", "Path of file to attach")

I hope this helps.
 
work...

Did this method ever worked ? (i am refering to 2nd respond)
 

Users who are viewing this thread

Back
Top Bottom