[Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

lotus notes replication

Posted on 2005-04-21
12
Medium Priority
?
4,784 Views
Last Modified: 2013-12-18
I use the following routine to send out the email via lotus notes (i use lotus domino objects - domobj.tlb)

There is just part of the routine I cut out from my form. I use late binding and believe me that works.

The only question is the mail doesn't send out until I open the lotus notes and the pop-up message "You have outgoing mail pending. Do you want to transfer it now?" If I click yes, then the mail got send out. It look like I need to do some replication somewhere? Is any way that I can force to replicate from my code without open up lotus Notes and then force to send outgoing mail?

Option Explicit
Dim COMSess 'As Domino.NotesSession
Dim COMDB 'As Domino.NotesDatabase
Dim FilePath As String

Private Sub cmdSend_Click()
    Dim Doc 'As NotesDocument
    Dim NItem ' As NotesItem

    'Creates new document/message
    If (IsEmpty(COMSess)) Then
        MsgBox "Lotus Notes does not install"
        Exit Sub
    End If
    Set Doc = COMDB.CreateDocument
    With Doc
        ' Creates Rich body item and adds all headers
        .AppendItemValue "Form", "memo"
        .AppendItemValue "SendTo", Split(Text1(0).Text, ",")
        .AppendItemValue "CopyTo", Text1(1).Text
        .AppendItemValue "Subject", Text1(2).Text
        .AppendItemValue "BODY", Text1(3).Text & vbCrLf
       
        ' Check is there is some files to attach to message
        ' if so, attaches them.
        If lstFiles.ListIndex <> -1 Then
            Dim obj As Object
            Dim I As Integer, UpperLstCount As Integer
           
            Set NItem = Doc.CreateRichTextItem("ATTACHMENT")
            UpperLstCount = lstFiles.ListCount
            For I = 0 To UpperLstCount - 1
                lstFiles.Selected(I) = True
                Set obj = NItem.EmbedObject(1454, "", lstFiles.Text)
                'Set obj = NItem.EmbedObject(EMBED_ATTACHMENT, "", lstFiles.Text)
            Next I
        End If
        .Send False
        MsgBox "mail sent", vbOKOnly
    End With
    Unload Me
End Sub


Private Sub CheckLotusNote()

    ' Creates new Notes session object and prompt user to
    ' enter servername, password and database mail.
    ' Prompt for password can be override if you pass password value
    ' as parameter of initialize method.
    ' This could be stored on registry/ini file to ask the
    ' user only the first time.
    ' I used inputbox for easy, you could add a form to get all
    ' values.
    On Error Resume Next
    Set COMSess = CreateObject("Lotus.NotesSession")
    'Set COMSess = New Domino.NotesSession
    If Err.Number Then
        MsgBox Err.Number & " - " & Err.Description
        Err.Clear
        Exit Sub
    End If
    COMSess.Initialize InputBox$("Please enter Database password.", "Enter Password")
    Set COMDB = COMSess.GetDatabase(InputBox$("Please enter Domino server name here.", "Server name", ""), InputBox$("Please enter Domino database name here.", "Enter database name", ""), False)
    With COMDB
        If Not .IsOpen Then
            MsgBox "Unable to open Notes session.", vbCritical, "Init Error"
            Set COMDB = Nothing
            Set COMSess = Nothing
            Exit Sub
        End If
    End With
End Sub
0
Comment
Question by:EDDYKT
  • 6
  • 5
12 Comments
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13840980
That happens when you end a session in the Notes-client and there is outgoing mail pending in the LOCAL mail.box. That means that you have a Notes-client installed on your system, and in your Location document you have specified under Mail that the Mail file location is on Local. You could set up the user for server-based mail, of course. You probably need the Notes-client?

You could use Registration.getUserInfo to find out if the user is set up for server-based mail or not. There is a command to force mail out, but I found it only for Formula-language:
    @Command([ReplicatorSendMail])
There's no real equivalent in LotusScript, AFAIK, buty you could try
    Database.Replicate(servername$)
0
 
LVL 26

Author Comment

by:EDDYKT
ID: 13843275

I did try this Database.Replicate(servername$)
but it doesn't work. It give me error message.

In my lotus notes, I set up the replication every 15 mins and do it in background.
Do you know what is the background task to replicate the mail?
If I don't run the lotus notes, does the replication stop too?
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13844577
Doesn't work? I expected that, more or less :-|
Just to be cetain, how did you try? With something like
      maildb.Replicate("homeserver/ACME")

The internal replication task of Notes doesn't run when Notes isn't active. I have no idea what the task is called, the name changes from implementation to implementation. In R6 the only task additional started by Notes is NTASKLDR, but you can do nothing with it directly.

If you want this to work properly, have a look at DIIOP and CORBA in the Designer Help database. A Java program can communicate directly with the server.
0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 
LVL 26

Author Comment

by:EDDYKT
ID: 13845391
i use the one that pass from the user which is from


Set COMDB = COMSess.GetDatabase(InputBox$("Please enter Domino server name here.", "Server name", ""), InputBox$("Please enter Domino database name here.", "Enter database name", ""), False)


Domino server name here
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13845689
What was the pararameter to COMDB.Replicate? Probably no good anyway...

Did you have a look at the possibilities with Corba/DIIOP?
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 13847075
WHat you have run into is NOT an accident.  You are relying on the Notes services to handle mail for you. The design of teh Notes mail services include mobile support, and if the user has elected to set things up foer mobile support, then you will get outgoing mail queued pending a USER request to send the queue.

For you its frustrating.  For a user who really is disconnected, it would be even more frustrating if your program FAILED in offline mode because you insisted on sending immediately.
0
 
LVL 26

Author Comment

by:EDDYKT
ID: 13851153
>>Did you have a look at the possibilities with Corba/DIIOP?

I'm not quite sure what is this.

All I want to know is
can i send email immediately by either from my program or set up
somewhere in lotus notes to achieve the goal.


>>You are relying on the Notes services to handle mail for you.

What is this service that I'm looking for. Can I configure this from notes lotus?

>>and if the user has elected to set things up foer mobile support, then you will get outgoing mail queued pending a USER request to send the queue.

I'm not quite sure of this.

From the code I show above, I tried to talk to the server directly by providing the password and server and nsf file (from mail directory). I thought to providing this I connect to the server directly.

0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13851192
With CORBA, you can call object functions from Java directly on the server, without even a local Notes installation. The DIIOP process on the server is required to handle those calls.

You can change the mail settings in the Location document in the Notes client, to indicate that mail should be handled on the Server (see earlier). Start Notes, click on the current location (probably Office) in the bottom-right corner of the screen, then click on Edit Current... Go to the Mail tab, and set the mail to be handled On Server.

And: what was the pararameter you tried for COMDB.Replicate(...)?
0
 
LVL 26

Author Comment

by:EDDYKT
ID: 13852305
I'm not familiar with CORBA and I will use VB in this case

>>Start Notes, click on the current location (probably Office) in the bottom-right corner of the screen, then click on Edit Current... Go to the Mail tab, and set the mail to be handled On Server

I will check this on Monday. If I set handled on server, does it mean i don't have any local copy of mail?
I'm not familiar with mail system at well.
0
 
LVL 46

Expert Comment

by:Sjef Bosman
ID: 13852970
CORBA can only be used from Java, but then you wouldn't need to use the Notes-client on your system. To learn more about Domino and CORBA, see the following links:
Domino developerworks: http://www-130.ibm.com/developerworks/lotus/
Documentation: http://www-10.lotus.com/ldd/doc
Domino Designer help: http://www-12.lotus.com/ldd/doc/domino_notes/Rnext/help6_designer.nsf/Main?OpenFrameSet

In the last link, click on Search, then type "Running a Java program". The second result found will explain CORBA. See also www.corba.org

> on Monday
There must be a good reason, as Qualetee suggested, that the user has his mail set to Local. Also, there may be many Location documents on the Notes client, on for every situation the user may be in. Each Location document contains the parameters for that particular situation. Notes might no longer work properly (in the eyes of the user) if you change the mail location without telling him/her the consequences.
0
 
LVL 26

Author Comment

by:EDDYKT
ID: 13857692
>>Start Notes, click on the current location (probably Office) in the bottom-right corner of the screen, then click on Edit Current... Go to the Mail tab, and set the mail to be handled On Server.


It seems work if i change to on server. It send all message out without replication.
I belive the downside is It doesn't support OFFLINE mode. right?

I'm trying to program an email utility that will run on the server (not email server) all the time and connect to the network. Is it safe I change to on server instead of local?
0
 
LVL 46

Accepted Solution

by:
Sjef Bosman earned 2000 total points
ID: 13857808
The strength of Notes is to allow the user to work offline. The user who sets his mail to On Local should know very well why this is set, and how to send mail out. If the user (with mail On Local) created a mail and forgot to send it away, he will be asked the same question when he closes Notes: "You have mail pending...". Standard Notes behaviour. I'd suggest NOT to change anything to your application. If the user isn't aware that he has local mail, then why is the mail set to On Local?? Is it maybe company policy, to increase network load or so? ;) Does the user know what the locations are for, and how to change them? Laptop users should at least change their current location when the connect  to or disconnect from a network.

So only set mail to On Server if the current location reflects a situation in which the system in on-line constantly.
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

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

For users on the Lotus Notes 8 Standard client, this article provides information on checking the Java Heap size and adjusting it to half of your system RAM in attempt to get the Lotus Notes 8.x Standard client to run faster.  I've had to exercise t…
This article covers general Notes 8.5 troubleshooting information including recreating the Notes\Data folder.
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
With just a little bit of  SQL and VBA, many doors open to cool things like synchronize a list box to display data relevant to other information on a form.  If you have never written code or looked at an SQL statement before, no problem! ...  give i…
Suggested Courses

868 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