Use Lotus Notes to send mail


I have to code an app that at some point in time will have to send some reports using Lotus Notes.

My questions are :

  1. Can I send mail through the Lotus Notes client, or something related to Lotus Notes ( a command line tool maybe? )? If so, where could I find information related to this? I would prefer not having to do it in C/C++, but if no other options' present, that would do.

  2. How can I find out the server's address? The GUI is not intuitive, and I can't find the server address. The server's located on another computer on the network.

Best Solution

Here's an example of half-a-decade old code to send a Notes mail from Excel VBA using the Notes OLE objects - guess they can be used in most of your preferred platforms:

Dim session As Object
Dim maildb As Object
Dim maildoc As Object
Dim body As Object

Public Sub send(subject, recipient, filename)
    On Error GoTo errorhandler
    Const EMBED_ATTACHMENT = 1454
    Call maildb.OpenMail

    If Not maildb.IsOpen Then Call maildb.Open("", "")

    Set maildoc = maildb.createdocument
    Set body = maildoc.createrichtextitem("body")

    Call maildoc.replaceitemvalue("form", "memo")
    Call maildoc.replaceitemvalue("subject", subject)

    Call body.EmbedObject(EMBED_ATTACHMENT, "", filename, subject)
    Call maildoc.send(false,recipient)
End Sub

Private Sub Class_Initialize()
    Set session = CreateObject("Notes.NotesSession")
    Set maildb = session.getDatabase("", "")
End Sub

The documentation for the various Notes objects can be found here: Lotus Domino Designer documentation

Related Question