Home > Ask the Domino Experts > Questions & Answers > Fetch e-mails in Domino using Java
Ask The Domino Expert: Questions & Answers
EMAIL THIS

Fetch e-mails in Domino using Java

Brian Mahoney EXPERT RESPONSE FROM: Brian Mahoney

Pose a Question
Other Domino Categories
Meet all Domino Experts
Become an Expert for this site
>
QUESTION POSED ON: 23 September 2003
I am trying to fetch e-mail messages in Domino using Java (DCO and Lotus Domino packages). I want to fetch messages with a given message ID from the user's inbox folder. How do I do that?

>
The Message ID is contained in the $MessageID field. For example, a newsletter from SearchDomino.com had the message ID "<20030702151524.57275282A@mailhost11.lists.techtarget.com>". To get a handle on this document in a users inbox, you could use the following code:
Sub Initialize
  Dim s As New NotesSession
  Dim db As NotesDatabase
  Dim view As NotesView
  Dim doc As NotesDocument
  Dim docNext As NotesDocument
  Dim item As NotesItem
  Dim strMessageID As String
  
  strMessageID =
 "<20030702151524.57275282A
@mailhost11.lists.techtarget.com>"
  
  Set db = s.GetDatabase("server", 
"mailfilename")
  Set view = "($InBox)"
  Set doc = view.GetFirstDocument
  While Not(doc Is Nothing)
    Set item = doc.GetFirstItem("$MessasgeID")
    If item.text = MessageID Then
      ' --- add whatever code you need to 
'process the document the way you wish
      ' --- possibly : Call doc.Remove
      Goto singleExit
    End If
    Set doc = dc.GetNextDocument(doc)
  Wend
  
singleExit:
  
End Sub


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary



Search and Browse the Expert Answer Center
Search and browse more than 25,000 question and answer pairs from more than 250 TechTarget industry experts.
Browse our Expert Advice



Lotus Notes Domino on Blackberry and mobile devices
HomeTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersDomino IT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts