Solved

Validating Domino Email Addresses from java and sending mail

Posted on 2004-04-20
3
1,226 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
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 125 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

ScreenConnect 6.0 Free Trial

Explore all the enhancements in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

Suggested Solutions

This is an old article, please see an updated version of this article, located here: http://www.experts-exchange.com/articles/23619/Notes-8-5x-Windows-7-Notes-info-and-tips.html
Lack of Storage capacity is a common problem that exists in every field of life. Here we are taking the case of Lotus Notes Emails, as we all know that we are totally depend on e-communication i.e. Emails. This article is fully dedicated to resolvin…
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

770 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