C
Chris Miller
Hi,
Im using redemption to get a mail item from outlook, this is working fine,
however, when listing its attachments I run the following code (safeMail is a
valid safemailitem from redemption:
Redemption.Attachments att = safeMail.Attachments;
Redemption.Attachment attachment = null;
for ( int i = 0; i < att.Count; i++ )
{
attachment = att.Item( i );
// regular attachment
if ( attachment.EmbeddedMsg == null )
{
CMessageAttachment baseAtt = new CMessageAttachment(
attachment.FileName, attachment.AsArray as Byte[] );
msg.Attachments.Add( baseAtt );
}
Marshal.ReleaseComObject( attachment );
attachment = null;
}
If i have an email with one attachment it works,
If i have an email with two attachments, it returns the first attachment
twice,
If i have an email with more than two attachments, it returns the first
attachment twice, and the rest of the attachments correctly there after
I'm using c# and interops, although I would have thought this code to be
correct.
Any ideas?
Many thanks
Im using redemption to get a mail item from outlook, this is working fine,
however, when listing its attachments I run the following code (safeMail is a
valid safemailitem from redemption:
Redemption.Attachments att = safeMail.Attachments;
Redemption.Attachment attachment = null;
for ( int i = 0; i < att.Count; i++ )
{
attachment = att.Item( i );
// regular attachment
if ( attachment.EmbeddedMsg == null )
{
CMessageAttachment baseAtt = new CMessageAttachment(
attachment.FileName, attachment.AsArray as Byte[] );
msg.Attachments.Add( baseAtt );
}
Marshal.ReleaseComObject( attachment );
attachment = null;
}
If i have an email with one attachment it works,
If i have an email with two attachments, it returns the first attachment
twice,
If i have an email with more than two attachments, it returns the first
attachment twice, and the rest of the attachments correctly there after
I'm using c# and interops, although I would have thought this code to be
correct.
Any ideas?
Many thanks