Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Validating Domino Email Addresses from java and sending mail

Posted on 2004-04-20
3
Medium Priority
?
1,455 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 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

Problem "Can you help me recover my changes?  I double-clicked the attachment, made changes, and then hit Save before closing it.  But when I try to re-open it, my changes are missing!"    Solution This solution opens the Outlook Secure Temp Fold…
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…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline

773 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