Sub SendMail (GroupName As String)
Dim Session As New NotesSession
Dim db As NotesDatabase
Dim message As NotesDocument
Dim NamesNSF As NotesDatabase
Dim GroupsView As NotesView
Dim GroupCol As NotesDocumentCollection
Dim Group As NotesDocument
Dim Members As NotesItem
Dim servername As String
Dim path As String
servername="SERVER01"
path="names.nsf"
Set NamesNSF= New NotesDatabase(servername,path)
If Not NamesNSF.Isopen Then
Call NamesNSF.Open(servername,path)
End If
Set GroupsView=NamesNSF.Getview("Groups")
Set GroupCol=GroupsView.Getalldocumentsbykey(GroupName, True)
Set Group=GroupCol.Getfirstdocument()
Set members=Group.Getfirstitem("Members")
Set db=session.CurrentDatabase
Set Message=db.Createdocument()
message.Form = "Memo"
message.Subject = "Уведомление о новой заявке на потребительский кредит"
message.Principal="Потребительское кредитование"
Message.SendTo=Members.Text
Call message.send(False)
End Sub