Search The ForumSearch   RegisterRegister  LoginLogin

MailBee SMTP

 AfterLogic Forum : MailBee SMTP
Subject Topic: Error Adding Attachment from Stream Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
PhilA
Newbie
Newbie


Joined: 26 May 2007
Online Status: Offline
Posts: 6
Posted: 26 May 2007 at 7:27am | IP Logged Quote PhilA

I am receiving the following error when trying to add an attachment from a MemoryStream object:

[NullReferenceException: Object reference not set to an instance of an object.]
   MailBee.Mime.AttachmentCollection.Add(Byte[] data, String targetFilename, String contentID, String contentType, HeaderCollection customHeaders, NewAttachmentOptions options, MailTransferEncoding mailEnc) +1437
   MailBee.Mime.AttachmentCollection.Add(Stre am stream, String targetFilename, String contentID, String contentType, HeaderCollection customHeaders, NewAttachmentOptions options, MailTransferEncoding mailEnc) +231
   InformationMiner.Email.GetAttachments(Smtp & email, String sConnString) in U:\InformationMiner\Email\Email.vb:211

I have also received the same error when trying to add an attachment from a Byte array.

I am retrieving data from a SQLServer DB and attaching this so I don't want to write the data to disk and then attach a file.

The line of code with the error is:

                      email.Message.Attachments.Add(memStream, myReader.GetString(0), "", myReader.GetString(1), email.Message.Headers, NewAttachmentOptions.ReplaceIfExists, MailTransferEncoding.Base64)


All variables contain data and can be referenced in debug code.

I have also tried replacing email.Message.Headers with Nothing (I'm using ASP.Net) and this results in the following error:

[NullReferenceException: Object reference not set to an instance of an object.]
   MailBee.Mime.AttachmentCollection.Add(Byte[] data, String targetFilename, String contentID, String contentType, HeaderCollection customHeaders, NewAttachmentOptions options, MailTransferEncoding mailEnc) +1437
   MailBee.Mime.AttachmentCollection.Add(Stre am stream, String targetFilename, String contentID, String contentType, HeaderCollection customHeaders, NewAttachmentOptions options, MailTransferEncoding mailEnc) +231
   InformationMiner.Email.GetAttachments(Smtp & email, String sConnString) in U:\InformationMiner\Email\Email.vb:211


Is there something I'm missing here ? Any help would be greatly appreciated.

Back to Top View PhilA's Profile Search for other posts by PhilA
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 26 May 2007 at 8:24am | IP Logged Quote Alex

Could you try the latest version of MailBee.NET.dll and let us know the outcome?

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
PhilA
Newbie
Newbie


Joined: 26 May 2007
Online Status: Offline
Posts: 6
Posted: 26 May 2007 at 9:53pm | IP Logged Quote PhilA

Unfortunately this is using the latest version - I downloaded it yesterday to try to fix the problem but it stil ocurred.

Regards,
Phil
Back to Top View PhilA's Profile Search for other posts by PhilA
 
PhilA
Newbie
Newbie


Joined: 26 May 2007
Online Status: Offline
Posts: 6
Posted: 26 May 2007 at 9:55pm | IP Logged Quote PhilA

Sorry, I should also mention that I'm using a trial key. I don't know whether this makes any difference.

If I can get this app working then I'll purchase a license but I wanted to try things first to see if this suits what I'm after.

Thanks,
Phil
Back to Top View PhilA's Profile Search for other posts by PhilA
 
Alex
AfterLogic Support
AfterLogic Support
Avatar

Joined: 19 November 2003
Online Status: Offline
Posts: 2206
Posted: 27 May 2007 at 10:05am | IP Logged Quote Alex

We reproduced the problem (it occurs when NewAttachmentOptions.ReplaceIfExists flag is set). The fix should be ready on Monday.

Regards,
Alex
Back to Top View Alex's Profile Search for other posts by Alex
 
PhilA
Newbie
Newbie


Joined: 26 May 2007
Online Status: Offline
Posts: 6
Posted: 27 May 2007 at 11:16am | IP Logged Quote PhilA

Excellent work Alex. It's great to see the immediate response - I'm very impressed and will definately be recommending we go with your product.

I look forward to testing the new release and purchasing the license on Monday.

Regards,
Phil
Back to Top View PhilA's Profile Search for other posts by PhilA
 
Andrew
AfterLogic Support
AfterLogic Support


Joined: 28 April 2006
Location: United States
Online Status: Offline
Posts: 1189
Posted: 28 May 2007 at 8:16am | IP Logged Quote Andrew

Please try the updated version of MailBee.NET.dll and let us know if it works as expected.


Best regards,
Andrew
Back to Top View Andrew's Profile Search for other posts by Andrew
 
PhilA
Newbie
Newbie


Joined: 26 May 2007
Online Status: Offline
Posts: 6
Posted: 28 May 2007 at 9:10am | IP Logged Quote PhilA

Great work guys !

It all appears to work well.

Thanks heaps,
Phil
Back to Top View PhilA's Profile Search for other posts by PhilA
 

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