Solved

Validating Domino Email Addresses from java and sending mail

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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying 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

Suggested Solutions

Title # Comments Views Activity
Lotus Notes 8.5 1 163
IBM Notes 9 crashed when open any attachment file 16 551
Add a cc field to email code 6 102
Cannot access mail archive from IBM domino 5 110
For Desktop Techs: How to retain a user's Notes configuration data when swapping out the end user's computer. (Assuming that you are not upgrading to a completely different version of Notes client) All you need to do is: 1) install Notes o…
Article by: Rob
Notes 8.5 Archiving Steps and Tips This article covers setting up a Notes archive, and helps understand some of the menu choices making setting up and maintaining a Notes archive file easier.

730 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