VB with Lotus Notes Mail

We currently have VB.-app sending emails to respective clients using an OLE constructed with help of MAPI ( I believe ) communicating with MS-Exchange Mail.
In near future we are planning to Move to Lotus-Notes Mail, I was looking for 1-1 converting tool or API which I  can use to program with VB.
i.e. use to create an OLE so that I could send an email/Fax via Lotus Notes from VB. App.
LVL 3
anuraviAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jjmartinConnect With a Mentor Commented:
Here is some code that will let your VB app tag into the existing Lotus Notes mail.  Include the lotus notes api in your program references.  

Private Sub cmdEmail_Click()

    Dim Resp As Integer
    Dim Server As String
    Dim UserDef As String
    Dim DefFile As String
    Dim NOTESSESSION As Object
    Dim NOTESDATABASE As Object
    Dim NOTESDOCUMENT As Object
    Dim NotesRichText As Object
   
    'Each person will have to have a different user definition file to access their Lotus Notes email, otherwise this has to be hardcoded in.... bad idea.
    'This is kept in a text file for easier change and update.
    DefFile = App.Path + "\userdef.txt"
    Open DefFile For Input As #1
         Input #1, Server, UserDef
    Close #1
   
    'This is an example of what the definitions need to look like.
    'Server = "PHX_SHR_NOTES03/blahblahblah"
    'UserDef = "MAIL\jmartin.nsf"
   
   
   
   
        'Here is where we tag into the Lotus Notes email system to send the email.
            Set NOTESSESSION = CreateObject("Notes.NotesSession")
            Set NOTESDATABASE = NOTESSESSION.GETDATABASE(Server, UserDef)
            'This is an example of what this looks like without the variables.
            'Set NotesDatabase = NotesSession.GetDatabase("PHX_SHR_NOTES03/American Express", "MAIL\jmartin.nsf")
            Set NOTESDOCUMENT = NOTESDATABASE.CREATEDOCUMENT
            Set NotesRichText = NOTESDOCUMENT.CREATERICHTEXTITEM("Body")

            NOTESDOCUMENT.Subject = txtSubject.Text 'This is the subject of the email an appears in the subject line
            NOTESDOCUMENT.Body = txtMessage.Text   'This is the actual message of the email
            NOTESDOCUMENT.SendTo = Email(lstNames.ListIndex)    'Here is the email address of the person your emailing to.
            NOTESDOCUMENT.SAVEMESSAGEONSEND = False 'This has to be set to False or we get errors
            NOTESDOCUMENT.SEND False    'Keep this set to false.
        End If
    End If
   
End Sub

Let me know if you have anymore questions.
0
 
anuraviAuthor Commented:
Appreciate your answer, did clear some of my doubts regarding api. I have a question though, The Lotus Notes API would it come with MS-Windows/ Notes Mail/Where???
I would like To know the exact name of the api, if possible.
Thanking u in anticipation.
0
 
jjmartinCommented:
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 
jjmartinCommented:
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 
ckhlamCommented:
This method will limited the mail client usabilitied.
If the VB application only need email send/received capilities, using MAPI client provided by Lotus Notes is a choice.
If so, you can using MAPI control in VB. I am using this method in my project.
0
All Courses

From novice to tech pro — start learning today.