Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Validating Domino Email Addresses from java and sending mail

Posted on 2004-04-20
3
Medium Priority
?
1,384 Views
Last Modified: 2013-12-18
I need to validate shortname entries against the name and address book in notes r5 and expand accordingly and send a mail message through domino.  Any thoughts on approach?  I would have to cycle through each user in the NAB and examine the shortname and grab real email address before constructing a valid email.  Can I send through domino or do i need to use smtp?

thanks for any help
brent
0
Comment
Question by:ccs34
[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
3 Comments
 
LVL 24

Expert Comment

by:HemanthaKumar
ID: 10868820
Take the name and do a search on ($VimPeople) view in NAB. This will return you the records matching the name entered in the search. Scan through this record for email address accordingly.

Look into Notes help on how to use GetDocumentByKey or GetAllDocumentsByKey in java

~Hemanth
0
 
LVL 31

Expert Comment

by:qwaletee
ID: 10869684
You can send through Domino using the shortname that's already set for each person, so long as these shortnames were set up uniquely.  Once you have that in place, you can send using the Notes Java API, or you can send via an SMTP server... though, if the SMTP server is not your Domino SMTP server, it may be set to only recognize a specific RFC822 name for each person.
0
 
LVL 3

Accepted Solution

by:
xp_commander earned 375 total points
ID: 10885726
(1) To search for a user by shortname

To find a user by shortname , long name , any format use undocumented "NABUtils" class included in package :- lotus.notes.addins.ispy

String search_str = "JSMITH"
NABUtils company_nab = new NABUtils();
Document doc = company_nab.getFirstDocumentFromAddressBook (session,company_nab.PERSON_RECORD, search_str );

(2) If the users belong to your domino domain, I assume than only you want to do a look up for them in NAB. In that situation , Notes would route the mail thru NRPC even without a need for SMTP server. All you need is to call send method , i.e. docmail.send(false, sendToVector)

A sample java code right from the Notes Help documentations :-  

import lotus.domino.*;
public class JavaAgent extends AgentBase {
  public void NotesMain() {
    try {
      Session session = getSession();
      AgentContext agentContext =
         session.getAgentContext();
      // (Your code goes here)
      Database db = agentContext.getCurrentDatabase();
      Document doc = db.createDocument();
      doc.replaceItemValue("Form", "Memo");
      doc.replaceItemValue("Subject", "Reminder");
      doc.setEncryptOnSend(true);
      doc.replaceItemValue("Body",
          "A document awaits your approval in " +
          db.getTitle() + ".");
      doc.send("John Smith");
    } catch(Exception e) {
      e.printStackTrace();
    }
  }
}
0

Featured Post

Industry Leaders: 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

  In today’s Arena we can’t imagine our lives without Internet as we are highly used to of it. If we consider our life style just for only 2 min we found that face to face communication is swapped by e-communication.  Every Where from Works place to…
Sometimes clients can lose connectivity with the Lotus Notes Domino Server, but there's not always an obvious answer as to why it happens.   Read this article to follow one of the first experiences I had with Lotus Notes on a client's machine, my…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

670 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