I have issues attempting to download from Gmail using the Pop3Client class.
In a POP3 telnet session ([pop.gmail.com](http://pop.gmail.com/)
995 +SSL):
+OK Gpop ready for requests from [ADDRESS]
USER [EMAIL]
+OK send PASS
PASS [PASSWORD]
+OK Welcome.
RETR 1
+OK message follows
…
RETR 2
+OK message follows
…
RETR 3
+OK message follows
…
This all proceeds how I would expect, with messages 2 and 3 having attachments, and each RETR command dumping the message as-is.
But with the following code, I download incomplete messages:
using (var client = new Pop3Client(“
[pop.gmail.com](http://pop.gmail.com/)
”, “[EMAIL]”, “[PASSWORD]”))
{
client.Port = 995;
client.SecurityMode = Pop3SslSecurityMode.Implicit;
client.EnableSsl = true;
client.Connect();
client.Login();// The server must implement this command
var nummessages = client.GetMessageCount();for (int i = 1; i <= nummessages; i++) // 1-based index for messages
{
try
{
using (var eml = client.FetchMessage(i))
{
eml.Save(@"Email " + i + “.eml”, Aspose.Network.Mail.MessageFormat.Eml);
eml.Save(@"Email " + i + “.msg”, Aspose.Network.Mail.MessageFormat.Msg);
}
}
catch (Pop3Exception ex)
{
Console.WriteLine(“Error retrieving message: {0}”, i);
Console.WriteLine(ex.ToString());
}
}// client.Quit();
// client.Disconnect();
}
For the e-mails above, only E-mail #1 comes through completely (it has no attachments). For #3, I open the resulting EML file and find:
MIME-Version: 1.0
Date: 12 Mar 2010 16:48:56 -0100
[End of file]
So, something with attachments seems to be amiss.