Properties
Name | Attachment name. |
Chunk | Binary stream of current attachment. |
ChunkSize | Size of binary stream of current attachment in byte. |
Size | Size of encoded content of attachment. |
ContentType | Content type of attachment. |
ContentId | Content Id of inline attachment. |
Headers | Headers of MIME part of current attachment. |
EncodedContent | Encoded content of attachment. |
Remarks
Attachment object contains all information of email attachment.
Usage Example
Dim server, user, password, requestAddr server = "localhost" user = "hunter@emailarchitect.net" password = "mypassword" requestAddr = "192.168.0.1" Dim oSvr Set oSvr = CreateObject("EmailArchitectObjects.ServerRoot") r = oSvr.Connect( server, user, password, 0, requestAddr ) If r <> 0 Then WScript.Echo( "connect server failed!" ) WScript.Quit End If Dim oDomains, oDomain Set oDomains = oSvr.DomainCollection Set oDomain = oDomains.Items(CStr(oSvr.Domain)) Dim oUsers, oUser Set oUsers = oDomain.UserCollection Set oUser = oUsers.Items(CStr(oSvr.User)) Dim oMBXs, oMBX, oTools Set oTools = CreateObject("EmailArchitectObjects.Tools") Set oMBXs = oUser.MBXCollection Set oMBX = oMBXs.Items(CStr(oTools.EncodeHex("inbox"))) Dim oMails, oMail Set oMails = oMBX.MailCollection 'get first mail in "Inbox" Dim i, nCount nCount = oMails.Count If nCount > 0 Then Set oMail = oMails.Items(CLng(0)) Else WScript.Quit End If 'enumerate all attachments. Dim Attachments, Attachment Set Attachments = oMail.AttachmentCollection nCount = Attachments.Count For i = 0 To nCount-1 Set Attachment = Attachments.Items(i) WScript.Echo( Attachment.Name ) Next