|
| Dear All,
I'm currently bilding up my test environment but I am wondering if
someone can save me a little time on this.
According to MSDN documentation the IBodyParts interface is read only
for the Count, Item and NewEnum properties. I am looking at using the Count
property to enemerate the pieces of an outbound SMTP message and then strip
any and all attachments that are anything other than the type text/html or
text/plain using the Delete method. Am I looking at this correctly or can I
only use the Delete method with items that I have created on the object or
can I remove other items from the IMessage object that I am working with?
example:
const cDisclaimer = "In order to reduce the size of your blackberry message
we have removed"
Sub ISMTPOnArrival_OnArrival(ByVal Msg, EventStatus )
'This will strip any attachments from the message.
Dim MessagePieces
Set MessagePieces = Msg.BodyPart
MessagePieces.DeleteAll
Msg.TextBody = Msg.TextBody & cDisclaimer & MessagePieces.Count &
"attachments"
'This will insert an HTML formated disclaimer to the end of the HTML portion
of the message
Msg.HTMLBody = Replace(Msg.HTMLBody,"</body>",("<P>"& cDisclaimer &
MessagePieces.Count & " attachments</P></body>"),1,-1,1)
Msg.DataSource.Save
EventStatus = cdoRunNextSink
End Sub
|
|