Solved

Validating Domino Email Addresses from java and sending mail

Posted on 2004-04-20
3
1,183 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
Comment Utility
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
Comment Utility
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
Comment Utility
(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

Highfive + Dolby Voice = No More Audio Complaints!

Poor audio quality is one of the top reasons people don’t use video conferencing. Get the crispest, clearest audio powered by Dolby Voice in every meeting. Highfive and Dolby Voice deliver the best video conferencing and audio experience for every meeting and every room.

Join & Write a Comment

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.
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now