Solved

Load recipient List From Mail Server

Posted on 2003-12-01
19
532 Views
Last Modified: 2013-12-18
I would like to know how can I load the list of recipient from my Mail Server into a listbox using Visual Basic. I want to allow the user to be able to just select from the list instead of having to type in manually themselves.

I have tried sending and mail in Visual basic using Sendto "Jerah Teo". It seems to work that way. Initially I thought when sending mail it always have to use the internet email address format such as jerahteo@yahoo.com but it seem that in lotus notes its not necessary. I can just use Jerah Teo. Is my assumption correct ? Can can I use this method to send mail say

Sendto listbox.text

Please advise?
0
Comment
Question by:jerahteo
[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
  • 8
  • 6
  • 5
19 Comments
 
LVL 31

Expert Comment

by:qwaletee
ID: 9854804
Your questino is a little bit confusing to me.  Are you asking how to load the "Address" dialog that apears when a user, in a Lotus Notes memo, presses the ADDRESS... button at the top?

I don't believe there is any exportable function you can call from VB without loading the Notes client.  if Notes is running, you can use the NotesUiWorkspace.PickListStrings method to display that dialog and get an aray of recipients returned.

You are also correct that when sending through Notes, you do not need to use the internet address format.  Notes natively uses the "Notes user ID" form, but also accepts many variants.  If it is unique, first name, last name, or even soundex of any name part will work.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 9854828
Qwaletee is correct in all aspects
0
 

Author Comment

by:jerahteo
ID: 9854877
I did come across some sample sometime ago but have lost the link. It did load the recipant list in VB without Lotus Notes application running.

My basic idea is to get the name list from the mail server. We have sister company all using lotus and therefore we have one share address book in the mail server. It is not possible to remember all the name therefore how can I load this the list of people from the address book located in the mail server.

Yes something like "Address" dialog that apears when a user, in a Lotus Notes memo.


0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 19

Expert Comment

by:madheeswar
ID: 9854985
0
 

Author Comment

by:jerahteo
ID: 9855080
Perhaps madheeswar mistake me for writing scripts in Lotus. I am developing total stand alone vb in vb6 environment.
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 9855095
I am in a hurry to post before Qwaletee.

So, while searching I got those two threads which will be help ful for u to look into.
The second link can have some tips which may halp u as well.

My answer is not on the spot. But, can help for the time being.

I am checking my database whether I have any links or code for ur requirement.

Wait for a while....
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9855235
I'm still not clear on what you are doing.  Where do you want data from? Are you looking for the complete list of users from the address book  i.e., a list of every possible e-Mail address?  Yes, you can retrieve that, but what I was pointing out is that you can't get the Lotus COM API to display a UI dialog, except as follows:

      Set ws = CreateObject("Notes.NotesUiWorkspace")
      result = ws.PickListStrings(0,True,"","","","Pick addresse(s)","Addressing",1)
      If Not Isarray(result) Then
            Print "non-array - cancel? " x
      Else
            For i = Lbound(result) To Ubound(result)
                  Print result(i)
            Next
      End If
0
 
LVL 31

Accepted Solution

by:
qwaletee earned 100 total points
ID: 9855394
But that does require the client to open.  If you wish to avoid having teh client open, you can run a loop that retrieves all names, but it will be really, really inefficient, unless you put in cahceing, lookahead, adn keysearch facilities similar to those found in teh dialog box displayed by the above code.  Here is a basic example:

      Const server = "your server name"
      Dim s As New NotesSession
      Dim directory As notesDatabase
      Set directory = s.getDatabase ( server , "names.nsf")
      Dim index As notesView
      Set index = directory.getView("People")
      Dim people As NotesViewNavigator
      Set people = index.CreateViewNav
      Dim entry As notesViewEntry
      Set entry = people.getFirst
      Print "Getting entries"
      Do Until entry Is Nothing
            Print "Address: " entry.columnvalues(1)
            Set entry = people.getNext(entry)
      Loop
0
 

Author Comment

by:jerahteo
ID: 9856006
May be let me explain again. I do not need the UI dialog. All I need is to go into the address book from the mail server and retrieve out the names and load it into the combo box in my vb application. So that the user do not need to type the name in the the Sendto field in my vb mail application. Just like going into the mail server to retrieve mail, I was wondering if there is any vb script which can be used to retrieve the names from the address book. I am looking for the complete list of users from the address book, a list of every possible e-Mail address.  

The first sample which you given is it for Lotus VB script or will it work for VB development script. Does the result here return a name from the address book.

     Set ws = CreateObject("Notes.NotesUiWorkspace")
     result = ws.PickListStrings(0,True,"","","","Pick addresse(s)","Addressing",1)
     If Not Isarray(result) Then
          Print "non-array - cancel? " x
     Else
          For i = Lbound(result) To Ubound(result)
               Print result(i)
          Next
     End If


0
 

Author Comment

by:jerahteo
ID: 9856331
Anybody encounter this error before.
When the session.initialise was excuted I get this

Runtime Error !

Program C:\Program Files\Microsoft Visual Basic\VB98\VB6.exe

abnormal program termination
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9856337
Both examples should work in VB 6.0.  The SECOND retrieves the list of names from the address book without invoking any client code, and should work OK for a small environment.  The FIRST uses the Notes client's dialog box, which has built-in efficiencies.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9856403
Very informative error message!  Can you at leas pin down the line it occured on?

When using Notes COM support, something like this most often happens in an incorrect client install.
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 9856425
Oh, and I gave madheeswar 1/2 hour to follow up!
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 9856467
Yeah. I am trying to figureout what caused problem.
0
 

Author Comment

by:jerahteo
ID: 9856594
I mean its not from the example you have given but its from my program which when it try to initialise the notes session in vb that error occur.
0
 

Author Comment

by:jerahteo
ID: 9856598
Do you mean I need to re-install my Lotus Notes ? That was what I want to try, I have reloaded my VB6 developement tools but that did not help !
0
 
LVL 19

Expert Comment

by:madheeswar
ID: 9856601
what is the version of LOtus Notes ur using?

Can we see the code which ur executing?
0
 

Author Comment

by:jerahteo
ID: 9863394
Ok We have come to the Final round I have kick runtime error. And tested the sample code which qwaletee had provided.

The first sample actually call up the Lotus Notes Address book dialog box and I don;t think I want that

The second sample is good in the sense that It interpret what I wanted it actually went to the server address book and load up all names and email address but I do agree that is no efficient therefore what I can do is that I will load all what I want to a local database and next time when I want any email instead of calling from the server I will call from my local database. Can I can maintain an up to date database by doing a update regularly.

So I conclude here and once again thanks to qwaletee.

You deserve the points.

0
 

Author Comment

by:jerahteo
ID: 9863412
Oh I forgot in your sample you have the following code
Do Until entry Is Nothing
          Print "Address: " entry.columnvalues(1)
          Set entry = people.getNext(entry)
     Loop


The entry.columnvalues(1) is for the field Telephone

0 - Name
1 - Telephone
2 - Company
3 - Email

Well as far as my address book is concern the above value apply, I do not know if this is a standard through out. Just for info
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Creating a bat file fo Note.ini 4 243
msxml3.dll: Not enough storage is available to complete this operation 13 990
Lotus notes email code 6 127
Only send email if contains "abcd" 3 153
For beginners of Lotus Notes user this is important to know about the types of files and their location supported by IBM Notes. Mostly users are unaware about how many file types are created and what their usages are. This Article is fully dedicated…
Notes Document Link used by IBM Notes is a link file which aids in the sharing of links to documents in email and webpages. The posts describe the importance and steps to create a Lotus Notes NDL file in brief.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial
Suggested Courses

734 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