Author |
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 30 June 2009 at 8:52am | IP Logged
|
|
|
if ((part.Disposition != null &&
part.Disposition.ToLower() == "attachment") ||
(part.Filename != null &&
part.Filename != string.Empty) ||
(part.ContentType != null &&
part.ContentType.ToLower() == "message/rfc822"))
{
I want to save the attachment here
}
|
Back to Top |
|
|
zedekiah Groupie
Joined: 24 June 2009 Location: United States
Online Status: Offline Posts: 44
|
Posted: 30 June 2009 at 9:12am | IP Logged
|
|
|
I need to save it to a byte[] field in the database.
I have been using ContentStream to save it but I dont see that now.
|
Back to Top |
|
|
Andrew AfterLogic Support
Joined: 28 April 2006 Location: United States
Online Status: Offline Posts: 1189
|
Posted: 01 July 2009 at 12:45am | IP Logged
|
|
|
If I understood you correctly, you download envelopes with body structure from an IMAP server, check them for attachments and need to download attachments from the IMAP server and save them.
If yes, please refer to this documentation page. This sample there completely downloads all image files attached or embedded into the last message in the inbox, and saves them into C:\Temp folder. However, initially, attachment data is retrieved as a byte array and you can easily open a stream reader for that array.
Best regards,
Andrew
|
Back to Top |
|
|