Author |
|
PhilA Newbie
Joined: 26 May 2007
Online Status: Offline Posts: 6
|
Posted: 26 May 2007 at 7:27am | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 26 May 2007 at 8:24am | IP Logged
|
|
|
Could you try the latest version of MailBee.NET.dll and let us know the outcome?
Regards,
Alex
|
Back to Top |
|
|
PhilA Newbie
Joined: 26 May 2007
Online Status: Offline Posts: 6
|
Posted: 26 May 2007 at 9:53pm | IP Logged
|
|
|
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 |
|
|
PhilA Newbie
Joined: 26 May 2007
Online Status: Offline Posts: 6
|
Posted: 26 May 2007 at 9:55pm | IP Logged
|
|
|
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 |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 27 May 2007 at 10:05am | IP Logged
|
|
|
We reproduced the problem (it occurs when NewAttachmentOptions.ReplaceIfExists flag is set). The fix should be ready on Monday.
Regards,
Alex
|
Back to Top |
|
|
PhilA Newbie
Joined: 26 May 2007
Online Status: Offline Posts: 6
|
Posted: 27 May 2007 at 11:16am | IP Logged
|
|
|
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 |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 28 May 2007 at 8:16am | IP Logged
|
|
|
Please try the updated version of MailBee.NET.dll and let us know if it works as expected.
Best regards,
Andrew
|
Back to Top |
|
|
PhilA Newbie
Joined: 26 May 2007
Online Status: Offline Posts: 6
|
Posted: 28 May 2007 at 9:10am | IP Logged
|
|
|
Great work guys !
It all appears to work well.
Thanks heaps,
Phil
|
Back to Top |
|
|