Working with attachments

The attachments of a message can be split into to categories:

Downloading attachments

By default, the library will not download the attachments automatically (unless you configure the client to do this). To download an attachment manually, do the following:

/* .. Init client, authenticate .. */        
/* .. folder = any folder .. */  
/* .. message = any message .. */  

var folderPath = @"C:\attachments";

foreach (var file in message.Attachments)
{
      file.Download(); // Downloading the attachment
}

Getting attachment data and saving files to disk

/* .. Init client, authenticate .. */        
/* .. folder = any folder .. */  
/* .. message = any message .. */  

var folderPath = @"C:\attachments";

foreach (var file in message.Attachments)
{
      file.Download(); // Downloading the attachment

      /*
            After downloading the attachment you can access its data
            through the FileData property.
      */     

      /*
            To save the file directly to disk, use the Save method.
      */     

      file.Save(folderPath /*, optional file name*/);
}


Next