Dead Mail Search and Report

Now you can search for dead mail by author or subject and compose a text and send it to anyone.
Dim session As New NotesSession
Dim db As NotesDatabase
Dim doc As NotesDocument
Dim object As NotesEmbeddedObject
Set db = session.GetDatabase("server", "mail.box" )
AutorDoc="CN=Admin Notes/O=xxxxx"
REM Set Vista= dbmail.GetView( "Mail" )
Dim collection As NotesDocumentCollection
Dim dateTime As New NotesDateTime("12/01/94")

searchFormula$ = "Form = ""NonDelivery Report"" & Routingstate =""DEAD"" & subject=""subject"" & from=""from@sss.com"""
Set collection = db.Search(searchFormula$,dateTime,0)
If collection.Count>=1Then
fileNum = Freefile
fecha=Date
Open "c:maildead.txt" For Output As fileNum
For i = 1 To collection.Count
Set doc = collection.GetNthDocument(i)
plainText=doc.from(0)+" "+doc.subject(0)+" "+doc.Sendto(0)
+" "+doc.deadFailureReason(0)
REM Messagebox plainText
Print #fileNum, plainText

Next
Close #fileNum
End If

REM CORREO RESPONSABLES
Set db=session.currentdatabase
Dim rtitem As NotesRichTextItem
Dim docB As NotesDocument
Set docB = New NotesDocument(db)
email = "tome@ert.com"
Set rtitem = New NotesRichTextItem( docB, "Body" )
Set object = rtitem.EmbedObject ( EMBED_ATTACHMENT, "", "c:maildead.txt")
docB.Form = "Memo"

docB.Subject = "MY DeaD MAILS"

docB.SendTo=email

docB.Body="Anexo archivo de estados de cuenta no enviados por el servidor"
docB.Importance="1"
docB.DeliveryPriority="H"
Call docB.send( False )

This was first published in November 2000

Dig deeper on Domino Resources - Part 3

0 comments

Oldest 

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

-ADS BY GOOGLE

SearchWinIT

Search400

  • iSeries tutorials

    Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

  • V6R1 upgrade planning checklist

    When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

  • Connecting multiple iSeries systems through DDM

    Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

SearchEnterpriseLinux

SearchVirtualDataCentre.co.UK

Close