Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Lotus Notes Email automation

Posted on 2001-07-04
5
Medium Priority
?
683 Views
Last Modified: 2007-11-27
Guys

I have an app, that will reside on a network that uses lotus notes as its email app.

I need to automate an email within my app when certain things happen.  Now I know how to do this with outlook and the mapi object, thats a doddle, but I have never tried this before.

I have a type lib file called domobj.tlb (lotus domino object), and I am not too sure whether this is good or not.

What I need to know is what DLL, TLB file do I need and also a quick snipet of code on how I would go about this.

Also if you have the dll file, then maybe you could email it to me, but we will cross that bridge when we get to it.

Cheers,

Ray.
0
Comment
Question by:raybetts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 3

Expert Comment

by:sridhar_PJ
ID: 6254417
Hi raybetts,
   If u want to send mails without using lotus client use vbsendmail object from www.freevbcode.com . It is available in http://www.freevbcode.com/ShowCode.Asp?ID=109


A simple method to send mail use lotus client object use this code.

Private Sub cmdSend_Click()
    Dim s As Object
    Dim db As Object
    Dim doc As Object
    Dim sMsg As String
   
's and db declared in general as object
    Set s = CreateObject("Notes.Notessession")    'create notes session
    Set db = s.getdatabase("", "")                'set db to database not yet named
    Call db.openmail                              'set database to default mail database
    Set doc = db.createdocument                   'notesdocument '.New  '(db)   ' create a mail document
    sMsg = "Mail has been sent: " & Date & "  " & Time & Chr(10) & "This is a test of an email message from VB." & vbCrLf & Text1.Text
'  Call doc.replaceitemvalue("SendTo", "Gary Devendorf/CAM/Lotus@Lotus") Hard coding address
  'Call doc.replaceitemvalue("SendTo", s.UserName) 'Notes client's user name (for testing)
    Call doc.replaceitemvalue("SendTo", "Eric Burdo")
    Call doc.replaceitemvalue("Subject", "VB message")
    Call doc.replaceitemvalue("Body", sMsg)
    Call doc.Send(False)                          'send the message
    MsgBox doc.getitemvalue("Body")(0)
    Set s = Nothing                               ' close connection to free memory
    Set db = Nothing
    Set doc = Nothing
End Sub


By the way what version of server u have
If u have Lotus Notes and Domino Release 5.0.2b then follow the method to send the mails

Link Lotus Notes to Visual Basic 6.0

With the introduction of Lotus Notes and Domino Release 5.0.2b, you now have the ability to manipulate the Domino object model via COM. As a result, you can use VB 6.0 to take advantage of Lotus/Domino services and databases.

To do so, however, you'll need Lotus Notes client version 5.02.b (or higher), Domino Designer client, or Domino Server. As with most Visual Basic object libraries, the programs need not be running to use them. Lotus has plans to make this runtime package distributable independent of its full software installation.

Next, set a reference to the Notes back-end DLL, Lotus Domino Objects. This object model conforms to a hierarchy similar to CDONTS, as seen in the sample code, which displays a message box with the first name in a Lotus Notes' address book. Notice that before you can access any of the objects within the NotesSession, you must initialize a session first.

Dim domSession As New Domino.NotesSession    
Dim domDatabase As New Domino.NotesDatabase
Dim domDocument As NotesDocument
Dim domViewEntry As NotesViewEntry
Dim domView As NotesView
Dim domViewNav As NotesViewNavigator
Dim strName As String

domSession.Initialize
Set domDatabase = domSession.GetDatabase("", _
     "names.nsf")  
Set domView = domDatabase.GetView("Contacts")
' This view contains the list of names
Set domViewNav = domView.CreateViewNav
Set domViewEntry = domViewNav.GetFirstDocument()
Set domDocument = domViewEntry.Document

strName = domDocument.GetItemValue("FullName")(0)
MsgBox strName

Set domViewEntry = Nothing
Set domViewNav = Nothing
Set domView = Nothing
Set domDocument = Nothing
Set domDatabase = Nothing
Set domSession = Nothing



Bye
Sridhar


0
 
LVL 43

Expert Comment

by:TimCottee
ID: 6255810
On my site in the downloads section http://www.geocities.com/TimCottee

There is a sample module which can simply be added to an existing project. This allows emails to be sent with Notes 4.x and 5.x. It includes the ability to send to multiple addressees and also include multiple attachments. All you need to do is add the module and then use the SendNotesMail function with the appropriate parameters. Attachment, SendTo, CC and BCC fields can include multiple elements seperated by commas.

Hope it helps.
0
 
LVL 1

Author Comment

by:raybetts
ID: 6256856
Thanks guys for what seems very good pointers, give me a week (roughly) and I will be back to award some points.  Thanks again for what seems to be very thorough answers.

Ray.
0
 
LVL 43

Accepted Solution

by:
TimCottee earned 1200 total points
ID: 6285101
Ray, how is it going?
0
 
LVL 1

Author Comment

by:raybetts
ID: 6287195
Worked a treat.

Cheers.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

636 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