Quantcast
Channel: ImapX 2
Viewing all articles
Browse latest Browse all 1952

New Post: Failed to reade Attachments using Imapx libry

$
0
0
When i am reading attachments it is displaying wrong count of attachments..if the email has only one attachment, i will get the output as 3. please someone help me to solve this,,
This is the code i use to get attachments..

// Getting the Attachments and insert into the database
                    List<ImapX.Attachment> attachmentList = message.Attachments;
                    if (attachmentList.Count > 0)
                    {
                        foreach (var attachment in attachmentList)
                        {
                            Model.Attachments myAttachment = new Model.Attachments();

                            myAttachment.MessageId = myMails;

                            myAttachment.AttachmentName = attachment.FileName;
                            myAttachment.AttachmentEncodings = attachment.FileEncoding;
                            myAttachment.BinaryData = attachment.FileData;
                            myAttachment.FileType = attachment.FileType;
                            myAttachment.FileSize = attachment.FileSize;
                            myAttachment.MailSubject = myMails.MailSubject;
                            myAttachment.MailUser = myMails;
                            myAttachment.FolderName = myMails;


                            // Insert Mails Into Mails table code gores here
                            bool resultAttachment = mailsToDb.insertIntoAttachmentTable(myAttachment);
                            if (resultAttachment)
                            {

                            }
                        }

Viewing all articles
Browse latest Browse all 1952

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>