Solved

VB with Lotus Notes Mail

Posted on 1998-07-22
5
670 Views
Last Modified: 2008-02-01
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.
0
Comment
Question by:anuravi
  • 3
5 Comments
 
LVL 3

Accepted Solution

by:
jjmartin earned 100 total points
ID: 1466392
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
 
LVL 3

Author Comment

by:anuravi
ID: 1466393
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
 
LVL 3

Expert Comment

by:jjmartin
ID: 1466394
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 
LVL 3

Expert Comment

by:jjmartin
ID: 1466395
This API will come with notes.  It is called the Lotus Notes Automation Classes.  The file is called notes32.tlb
0
 

Expert Comment

by:ckhlam
ID: 2603308
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

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now