December
18
This Lotus Notes script strips email attchements using an Agent instead of Rules.
Lets say you want to forward mail from your Lotus Notes account but want to strip attachments, you’ll definitely want to try the following script. It’s perfect for sending your mail to your sexy new iPhone without racking up ridiculous bandwidth charges.
This works in Notes 8, but has not been tested in earlier versions. Also be sure to replace YOUREMAIL@MAIL.COM with an external email address. Credit should go to Simon Lacasse who did the nitty gritty work, I’m just making sure others can benefit from it.
Sub Initialize
Dim session As New NotesSession
Dim db As NotesDatabase
Dim collection As NotesDocumentCollection
Dim memo As NotesDocument
Dim doc As NotesDocument
Dim j As Integer
Set db = session.CurrentDatabase
Set collection = db.UnprocessedDocuments
For j = 1 To collection.Count
Set memo = collection.GetNthDocument( j )
''If Not( memo.SentByAgent ) Then
Set doc = New NotesDocument( db )
Call doc.CopyAllItems( memo, True )
Dim rtitem As NotesRichTextItem
Set rtitem = memo.GetFirstItem("Body")
doc.Form = "Memo"
doc.Subject = "From :" + memo.From(0) + ":" + memo.Subject( 0 )
doc.Body = memo.Body
doc.Principal = memo.from(0)
''doc.InetFrom = memo.SMTPOriginator
doc.ReplyTo = memo.from(0)
Call doc.Send( True, "YOUREMAIL@MAIL.COM" )
'Call doc.Send( False, "Put another EMail address here" )
'' End If
Call session.UpdateProcessedDoc( memo )
Next
End Sub