| Author |  | 
      
        | Thomas Newbie
 
  
 
 Joined: 03 February 2011
 Online Status: Offline
 Posts: 2
 | 
          Hello there,
           | Posted: 03 February 2011 at 9:13am | IP Logged |   |  
           | 
 |  
 So I am trying to create an attachment directly from a database (rather from the file-system). Unfortunately its not working as expected...so here is what I'm doing in C#:
 
 Attachment att = new Attachment(MimePart.Parse(data));
 (data is a byte-array which is coming from a database)
 
 First...is this the correct way to create attachments without storing them first on the filesystem? I dont want to pull it from the database, store it locally and then create the attachment...
 
 So the problem is, the "att" object does not have the ContentType filled out (empty string) also the "Name" Property tells me that "att.Name threw an exception of type System.NullReferenceException" so obviously something went wrong ;)
 
 Is there something "special" i need to do first? Is my byte-array corrupt? Any ideas? I'm using Mailbee.net version 5.6.2.150
 
 Thanks a lot in advance
 thomas
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Igor AfterLogic Support
 
  
 
 Joined: 24 June 2008
 Location: United States
 Online Status: Offline
 Posts: 6168
 | 
          Why don't you use Add overload which accepts byte array as a parameter?
           | Posted: 04 February 2011 at 1:28am | IP Logged |   |  
           | 
 |  
 I'd also suggest to upgrade to the latest DLL build, maybe there are some issues in older version.
 
 --
 Regards,
 Igor, AfterLogic Support
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Thomas Newbie
 
  
 
 Joined: 03 February 2011
 Online Status: Offline
 Posts: 2
 | 
          Thank you, it works with the Add overload function.
           | Posted: 07 February 2011 at 2:14am | IP Logged |   |  
           | 
 |  | 
       
        | Back to Top |     | 
       
       
        |  |