0 votes

We are getting below error messages while trying to download attachments from below code.

List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);

foreach (MessageInfo info in infos)
{
    var eml = imap.GetMessageByUID(info.UID.Value)
    IMail email = new MailBuilder().CreateFromEml(eml);

    foreach (MimeData attachment in email.Attachments)
    {
        attachment.Save(Path.Combine(attachPath, attachment.SafeFileName));
    }
}

Error Messages are

Tried to read a line. Only '' received. Please make sure that antivirus and firewall software are disabled or configured correctly.

Tried to read 4504347 bytes, only 180224 received. Please make sure that antivirus and firewall software are disabled or configured correctly.

Thanks

by (200 points)
"Please make sure that you have disabled antivirus and firewall software or that you have configured them correctly."

we are using Office 365 mail account. i hope microsoft enabled firewall properly.

On extremely slow networks you may increase timeout values: ReceiveTimeout and SendTimeout.

We will try above option and update on this.

Thanks you very much for your response.

1 Answer

0 votes

Please make sure that you have disabled antivirus and firewall software or that you have configured them correctly.

Many reports show that AVG antivirus tracks IMAP sessions and interrupts them with no reason.

In most cases this error means that the connection was interrupted. It was lost, the server disconnected or your antivirus/firewall cut the connection.

In technical terms, it means exactly what the exception’s message says: component tried to read specified amount of data, data was expected in accordance to the protocol, but it has not been received during the specified time.

On extremely slow networks you may increase timeout values: ReceiveTimeout and SendTimeout.

If increasing timeout values doesn’t help, it means that the connection was dropped by the remote server or some intermediary router – you’ll need to connect again.

by (301k points)
...