Search The ForumSearch   RegisterRegister  LoginLogin

MailBee.NET SMTP

 AfterLogic Forum : MailBee.NET SMTP
Subject Topic: Create Attachment from Byte-array Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Thomas
Newbie
Newbie


Joined: 03 February 2011
Online Status: Offline
Posts: 2
Posted: 03 February 2011 at 9:13am | IP Logged Quote Thomas

Hello there,

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 View Thomas's Profile Search for other posts by Thomas
 
Igor
AfterLogic Support
AfterLogic Support


Joined: 24 June 2008
Location: United States
Online Status: Offline
Posts: 6104
Posted: 04 February 2011 at 1:28am | IP Logged Quote Igor

Why don't you use Add overload which accepts byte array as a parameter?

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 View Igor's Profile Search for other posts by Igor
 
Thomas
Newbie
Newbie


Joined: 03 February 2011
Online Status: Offline
Posts: 2
Posted: 07 February 2011 at 2:14am | IP Logged Quote Thomas

Thank you, it works with the Add overload function.
Back to Top View Thomas's Profile Search for other posts by Thomas
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump

Powered by Web Wiz Forums version 7.9
Copyright ©2001-2004 Web Wiz Guide