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

x
  • 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.
0
Natashenka
Asked:
Natashenka
1 Solution
 
snocrossCommented:
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)
     Wend
     
     Print("Agent Finished")
End Sub
0

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