Hi Team,
We have faced with situation when some emails are not getting deleted (or marked as read by Aspose) from GMail account using POP3 protocol. This behavior we can reproduce only our customer end. So I uploaded email, end of session’s screenshot. We use 19.5 version, but it seems like this problem is missing at least in the latest version of Aspose 19.11…
So the question is do you know about this problem?
If so what the cause of this problem was?
I’ve uploaded archive with screenshot and email: AsposeForum.zip (489.3 KB)
Steps to reproduce:
- Forward email to gmail account.
- Receive email using Aspose’s POP3 client
- We’re getting a loop forever because emails aren’t mark as read
SourceCode:
string outputPath = ConfigurationManager.AppSettings[“OutputPath”];
var pop3ClientConnection = new Pop3Client();
var msgCount = 0;
List<string> messagesIDs = new List<string>();
try
{
pop3ClientConnection.Host = host;
pop3ClientConnection.Port = 995;
pop3ClientConnection.Username = user;
pop3ClientConnection.Password = psw;
pop3ClientConnection.SecurityOptions = SecurityOptions.SSLAuto;
pop3ClientConnection.UseDefaultCredentials = useDefCred;
msgCount = pop3ClientConnection.GetMessageCount();
for (int i = 1; i <= msgCount; i++)
{
messagesIDs.Add(pop3ClientConnection.GetMessageUniqueId(i));
}
foreach (var messagesID in messagesIDs)
{
Aspose.Email.MailMessage msg = pop3ClientConnection.FetchMessage(messagesID);
if (msg.BodyType == BodyContentType.PlainText)
{
msg.Save(outputPath + messagesID + "Msg.msg", SaveOptions.DefaultMsg);
}
else if (msg.BodyType == BodyContentType.Html)
{
using (MemoryStream ms = new MemoryStream())
{
HtmlSaveOptions htmlSaveOption = new HtmlSaveOptions();
htmlSaveOption.HtmlFormatOptions |= HtmlFormatOptions.WriteHeader |
HtmlFormatOptions.WriteCompleteEmailAddress |
HtmlFormatOptions.WriteCompleteCcEmailAddress;
htmlSaveOption.CheckBodyContentEncoding = true;
msg.Save(ms, htmlSaveOption);
File.WriteAllBytes(outputPath + "output.htm", ms.ToArray());
}
}
pop3ClientConnection.DeleteMessage(messagesID);
pop3ClientConnection.CommitDeletes();
}
}
catch (Exception e)
{
return "Houston we have a problem.. " + e;
}