aspNetIMAP

BodyStructureAttachment Class

An attachment that is defined by a BodyStructure

For a list of all members of this type, see BodyStructureAttachment Members.

System.Object
BodyStructureAttachment

publicclassBodyStructureAttachment

Thread Safety

Public static (Shared in Visual Basic) members of this type are safe for multithreaded operations. Instance members are not guaranteed to be thread-safe.

Example

          [C#]
IMAP4 imap = new IMAP4( "127.0.0.1" );
imap.Username = "dave@blah.com";
imap.Password = "test";
 
imap.Logger  = new IMAPLog( "c:\\imap.log" ); 
imap.Login();
 
MailFolder mf = imap.SelectInbox();
 
//grab the BodyStructure of the newest message
int count = mf.MessageCount;
 
BodyStructure bs = mf.FetchClient.BodyStructure( count );
 
BodyStructureAttachment[] attachments = bs.Attachments();
 
foreach(BodyStructureAttachment bsa in attachments )
{
    //write out the name and the id
    Console.WriteLine( "{0}:{1}", bsa.BodyStructureId, bsa.Name  );
}
 
Console.WriteLine( "Done" );
Console.ReadLine();
    
          [VB.NET]
Dim imap As New IMAP4("127.0.0.1")
imap.Username = "dave@blah.com"
imap.Password = "test"
 
imap.Logger = New IMAPLog("c:\imap.log")
imap.Login()
 
Dim mf As MailFolder = imap.SelectInbox()
 
'grab the BodyStructure of the newest message
Dim count As Integer = mf.MessageCount
 
Dim bs As BodyStructure = mf.FetchClient.BodyStructure(count)
 
Dim attachments As BodyStructureAttachment() = bs.Attachments()
 
Dim bsa As BodyStructureAttachment
For Each bsa In  attachments
   'write out the name and the id
   Console.WriteLine("{0}:{1}", bsa.BodyStructureId, bsa.Name)
Next bsa
 
Console.WriteLine("Done")
Console.ReadLine()
    

Requirements

Namespace: aspNetIMAP

Assembly: aspNetIMAP (in aspNetIMAP.dll)

See Also

BodyStructureAttachment Members | aspNetIMAP Namespace