0

can you please tell me what i am doing wrong. I already downloaded the headers before. So the Message is not null. But msg.Body is null. Only if i downlaod with folder.Messages.Download and use the UID it will work.

                Message aMassage = folder.Messages[index];

                // this is not working
                aMassage.Download(MessageFetchMode.Body);

                // this is working to download body
                long[] arrLong = new long[1];
                arrLong[0] = aMassage.UId;
                folder.Messages.Download(arrLong, MessageFetchMode.Body);
leon
  • 21
  • 4

1 Answers1

0

i've passed this issue. Change your MessageFetchMode to Basic

    public List<Message> BuscarMensagens(string _Diretorio)
    {
        try
        {
            List<Message> lMsg;

            if (MailClient.Folders[_Diretorio].Exists > 0)
            {
                lMsg = new List<Message>();
                lMsg = MailClient.Folders[_Diretorio].Search("UNSEEN",MessageFetchMode.Basic).ToList();

                return lMsg;
            }
            else
            {
                return null;
            }
        }
        catch (Exception)
        {

            throw;
        }
    }