Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 612
  • Last Modified:

Send Mail to Address Book in LotusScript

    I am having trouble writing a LotusScript application that will send a particular email to everyone on my Notes Address book (names.nsf) so long as they have email at a particular domain (like send a message only to hotmail accounts). Does anyone know a script I could use to do this (pretty please?). I run Notes RNext and Smart Suite 9.5.
1 Solution
Hi, I think this Lotusscript code will work for your situation:

Sub Initialize
     Dim SourceDb As NotesDatabase
     Dim DestDb As NotesDatabase
     Dim SourceView As Notesview
     Dim View As Notesview
     Dim SourceDoc As Notesdocument
     Dim DestDoc As Notesdocument
     Print("Agent Started")
     Set SourceDb = New NotesDatabase("YourServerNameHere", "names.nsf")
     Set DestDb = New NotesDatabase("YourServerNameHere", "DatabaseNameContainingAgentHere.nsf")
     Set DestView = DestDb.GetView("NotesNameLookup")
     Set SourceView = SourceDb.GetView("People")
     Set SourceDoc = SourceView.GetFirstDocument
     While Not SourceDoc Is Nothing
          Set BackDoc = New NotesDocument(DestDb)
          BackDoc.form = "Memo"
          BackDoc.subject = "Important email for hotmail users"
          BackDoc.sendTo = SourceDoc.InternetAddress(0)
          BackDoc.Body = "Your message here"
          Call BackDoc.Send(True)
          Set SourceDoc = SourceView.GetNextDocument(SourceDoc)
     Print("Agent Finished")
End Sub

Featured Post

Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now