POP3 not fetch newest emails on GMail












1















I use mailkit pop3 to fetch emails, but I find it didn't fetch newest emails and each time I run it return different messages count number



using (Pop3Client client = new Pop3Client())
{
// Connect to the server
client.Connect(hostname, port, useSsl);
client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate((username), password);
int messageCount = client.Count;
// var folder = client.;

// We want to download all messages
List<MimeMessage> allMessages = new List<MimeMessage>(messageCount);

for (int i = messageCount - 1; i > 0; i--)
{
var msg = client.GetMessage(i);
allMessages.Add(msg);
}
}


I supposed that all messages variable should be filled with all emails ordered from newest emails to old emails but I found all messages return old emails and not contains at all new emails at all, I searched a lot and didn't find the reason, Do you know why that happened and how can I fix that ?
I wish to find any help here and Thanks in advance










share|improve this question

























  • Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

    – Klaus Gütter
    Nov 15 '18 at 9:26











  • I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

    – sabreen saber
    Nov 15 '18 at 9:38
















1















I use mailkit pop3 to fetch emails, but I find it didn't fetch newest emails and each time I run it return different messages count number



using (Pop3Client client = new Pop3Client())
{
// Connect to the server
client.Connect(hostname, port, useSsl);
client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate((username), password);
int messageCount = client.Count;
// var folder = client.;

// We want to download all messages
List<MimeMessage> allMessages = new List<MimeMessage>(messageCount);

for (int i = messageCount - 1; i > 0; i--)
{
var msg = client.GetMessage(i);
allMessages.Add(msg);
}
}


I supposed that all messages variable should be filled with all emails ordered from newest emails to old emails but I found all messages return old emails and not contains at all new emails at all, I searched a lot and didn't find the reason, Do you know why that happened and how can I fix that ?
I wish to find any help here and Thanks in advance










share|improve this question

























  • Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

    – Klaus Gütter
    Nov 15 '18 at 9:26











  • I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

    – sabreen saber
    Nov 15 '18 at 9:38














1












1








1








I use mailkit pop3 to fetch emails, but I find it didn't fetch newest emails and each time I run it return different messages count number



using (Pop3Client client = new Pop3Client())
{
// Connect to the server
client.Connect(hostname, port, useSsl);
client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate((username), password);
int messageCount = client.Count;
// var folder = client.;

// We want to download all messages
List<MimeMessage> allMessages = new List<MimeMessage>(messageCount);

for (int i = messageCount - 1; i > 0; i--)
{
var msg = client.GetMessage(i);
allMessages.Add(msg);
}
}


I supposed that all messages variable should be filled with all emails ordered from newest emails to old emails but I found all messages return old emails and not contains at all new emails at all, I searched a lot and didn't find the reason, Do you know why that happened and how can I fix that ?
I wish to find any help here and Thanks in advance










share|improve this question
















I use mailkit pop3 to fetch emails, but I find it didn't fetch newest emails and each time I run it return different messages count number



using (Pop3Client client = new Pop3Client())
{
// Connect to the server
client.Connect(hostname, port, useSsl);
client.AuthenticationMechanisms.Remove("XOAUTH2");
client.Authenticate((username), password);
int messageCount = client.Count;
// var folder = client.;

// We want to download all messages
List<MimeMessage> allMessages = new List<MimeMessage>(messageCount);

for (int i = messageCount - 1; i > 0; i--)
{
var msg = client.GetMessage(i);
allMessages.Add(msg);
}
}


I supposed that all messages variable should be filled with all emails ordered from newest emails to old emails but I found all messages return old emails and not contains at all new emails at all, I searched a lot and didn't find the reason, Do you know why that happened and how can I fix that ?
I wish to find any help here and Thanks in advance







c# gmail pop3 mailkit






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 13:46









jstedfast

19.2k25177




19.2k25177










asked Nov 15 '18 at 9:23









sabreen sabersabreen saber

267




267













  • Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

    – Klaus Gütter
    Nov 15 '18 at 9:26











  • I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

    – sabreen saber
    Nov 15 '18 at 9:38



















  • Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

    – Klaus Gütter
    Nov 15 '18 at 9:26











  • I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

    – sabreen saber
    Nov 15 '18 at 9:38

















Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

– Klaus Gütter
Nov 15 '18 at 9:26





Didn't you ask the same question already: stackoverflow.com/questions/53303349/…

– Klaus Gütter
Nov 15 '18 at 9:26













I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

– sabreen saber
Nov 15 '18 at 9:38





I didn't clear in old question that fetched emails not contains the newest emails, and I said it's not ordered but i found the problem it fetch group of old ordered emails but not get the newest emails

– sabreen saber
Nov 15 '18 at 9:38












1 Answer
1






active

oldest

votes


















1














Are you connecting to GMail, by any chance?



This is a GMail behavior where, depending on your POP settings (as set in the GMail web app Settings page), will determine what messages the client sees.



This is not a MailKit issue.



From Google's own FAQ in the section titled "Emails aren't downloading correctly", it states:




After you set up POP in your Gmail settings, your emails become available
in batches. It might take a while to see all your emails.



Note: Gmail downloads a copy of every email you send or receive, except
for emails in Chats, Spam, and Trash. To avoid duplicates, Gmail doesn't
download emails sent within your mail client, but you can still see them
if you log in to Gmail.



If you continue to have problems downloading emails, try using recent
mode:




  1. In your email client's POP settings page, find the "Email address" or
    "User name" field.

  2. Add recent: in front of your email address. For example,
    recent:example@gmail.com.


If that doesn't fix the problem, try deleting your Gmail address from your email client, then re-adding it.







share|improve this answer


























  • but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

    – sabreen saber
    Nov 15 '18 at 12:01













  • and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

    – sabreen saber
    Nov 15 '18 at 12:04











  • What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

    – jstedfast
    Nov 15 '18 at 12:09











  • Your gmail settings are wrong. I guarantee it.

    – jstedfast
    Nov 15 '18 at 12:13











  • Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

    – jstedfast
    Nov 15 '18 at 12:22











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316125%2fpop3-not-fetch-newest-emails-on-gmail%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









1














Are you connecting to GMail, by any chance?



This is a GMail behavior where, depending on your POP settings (as set in the GMail web app Settings page), will determine what messages the client sees.



This is not a MailKit issue.



From Google's own FAQ in the section titled "Emails aren't downloading correctly", it states:




After you set up POP in your Gmail settings, your emails become available
in batches. It might take a while to see all your emails.



Note: Gmail downloads a copy of every email you send or receive, except
for emails in Chats, Spam, and Trash. To avoid duplicates, Gmail doesn't
download emails sent within your mail client, but you can still see them
if you log in to Gmail.



If you continue to have problems downloading emails, try using recent
mode:




  1. In your email client's POP settings page, find the "Email address" or
    "User name" field.

  2. Add recent: in front of your email address. For example,
    recent:example@gmail.com.


If that doesn't fix the problem, try deleting your Gmail address from your email client, then re-adding it.







share|improve this answer


























  • but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

    – sabreen saber
    Nov 15 '18 at 12:01













  • and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

    – sabreen saber
    Nov 15 '18 at 12:04











  • What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

    – jstedfast
    Nov 15 '18 at 12:09











  • Your gmail settings are wrong. I guarantee it.

    – jstedfast
    Nov 15 '18 at 12:13











  • Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

    – jstedfast
    Nov 15 '18 at 12:22
















1














Are you connecting to GMail, by any chance?



This is a GMail behavior where, depending on your POP settings (as set in the GMail web app Settings page), will determine what messages the client sees.



This is not a MailKit issue.



From Google's own FAQ in the section titled "Emails aren't downloading correctly", it states:




After you set up POP in your Gmail settings, your emails become available
in batches. It might take a while to see all your emails.



Note: Gmail downloads a copy of every email you send or receive, except
for emails in Chats, Spam, and Trash. To avoid duplicates, Gmail doesn't
download emails sent within your mail client, but you can still see them
if you log in to Gmail.



If you continue to have problems downloading emails, try using recent
mode:




  1. In your email client's POP settings page, find the "Email address" or
    "User name" field.

  2. Add recent: in front of your email address. For example,
    recent:example@gmail.com.


If that doesn't fix the problem, try deleting your Gmail address from your email client, then re-adding it.







share|improve this answer


























  • but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

    – sabreen saber
    Nov 15 '18 at 12:01













  • and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

    – sabreen saber
    Nov 15 '18 at 12:04











  • What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

    – jstedfast
    Nov 15 '18 at 12:09











  • Your gmail settings are wrong. I guarantee it.

    – jstedfast
    Nov 15 '18 at 12:13











  • Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

    – jstedfast
    Nov 15 '18 at 12:22














1












1








1







Are you connecting to GMail, by any chance?



This is a GMail behavior where, depending on your POP settings (as set in the GMail web app Settings page), will determine what messages the client sees.



This is not a MailKit issue.



From Google's own FAQ in the section titled "Emails aren't downloading correctly", it states:




After you set up POP in your Gmail settings, your emails become available
in batches. It might take a while to see all your emails.



Note: Gmail downloads a copy of every email you send or receive, except
for emails in Chats, Spam, and Trash. To avoid duplicates, Gmail doesn't
download emails sent within your mail client, but you can still see them
if you log in to Gmail.



If you continue to have problems downloading emails, try using recent
mode:




  1. In your email client's POP settings page, find the "Email address" or
    "User name" field.

  2. Add recent: in front of your email address. For example,
    recent:example@gmail.com.


If that doesn't fix the problem, try deleting your Gmail address from your email client, then re-adding it.







share|improve this answer















Are you connecting to GMail, by any chance?



This is a GMail behavior where, depending on your POP settings (as set in the GMail web app Settings page), will determine what messages the client sees.



This is not a MailKit issue.



From Google's own FAQ in the section titled "Emails aren't downloading correctly", it states:




After you set up POP in your Gmail settings, your emails become available
in batches. It might take a while to see all your emails.



Note: Gmail downloads a copy of every email you send or receive, except
for emails in Chats, Spam, and Trash. To avoid duplicates, Gmail doesn't
download emails sent within your mail client, but you can still see them
if you log in to Gmail.



If you continue to have problems downloading emails, try using recent
mode:




  1. In your email client's POP settings page, find the "Email address" or
    "User name" field.

  2. Add recent: in front of your email address. For example,
    recent:example@gmail.com.


If that doesn't fix the problem, try deleting your Gmail address from your email client, then re-adding it.








share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 15 '18 at 13:01

























answered Nov 15 '18 at 11:54









jstedfastjstedfast

19.2k25177




19.2k25177













  • but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

    – sabreen saber
    Nov 15 '18 at 12:01













  • and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

    – sabreen saber
    Nov 15 '18 at 12:04











  • What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

    – jstedfast
    Nov 15 '18 at 12:09











  • Your gmail settings are wrong. I guarantee it.

    – jstedfast
    Nov 15 '18 at 12:13











  • Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

    – jstedfast
    Nov 15 '18 at 12:22



















  • but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

    – sabreen saber
    Nov 15 '18 at 12:01













  • and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

    – sabreen saber
    Nov 15 '18 at 12:04











  • What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

    – jstedfast
    Nov 15 '18 at 12:09











  • Your gmail settings are wrong. I guarantee it.

    – jstedfast
    Nov 15 '18 at 12:13











  • Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

    – jstedfast
    Nov 15 '18 at 12:22

















but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

– sabreen saber
Nov 15 '18 at 12:01







but when I use OpenPop.Mime.Message I were getting all newest emails always with the same gmail setting

– sabreen saber
Nov 15 '18 at 12:01















and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

– sabreen saber
Nov 15 '18 at 12:04





and after i change to mailkit i logined to gmail account and look at settings again and Enable POP for all mail (even mail that's already been downloaded) but I still not get newest emails , and i don't know based on what it retrieve emails

– sabreen saber
Nov 15 '18 at 12:04













What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

– jstedfast
Nov 15 '18 at 12:09





What are the odds that I was able to correctly guess your pop server based on your question if I’m wrong? 0.

– jstedfast
Nov 15 '18 at 12:09













Your gmail settings are wrong. I guarantee it.

– jstedfast
Nov 15 '18 at 12:13





Your gmail settings are wrong. I guarantee it.

– jstedfast
Nov 15 '18 at 12:13













Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

– jstedfast
Nov 15 '18 at 12:22





Read this: mail.google.com/support/bin/answer.py?answer=13291 - specifically, read the link “ Emails aren’t downloading correctly”

– jstedfast
Nov 15 '18 at 12:22




















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53316125%2fpop3-not-fetch-newest-emails-on-gmail%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Florida Star v. B. J. F.

Danny Elfman

Retrieve a Users Dashboard in Tumblr with R and TumblR. Oauth Issues