This is a post related to my previous pop3 post. For this I downgraded from 4.9 to 4.7.2.4. I am having issues when I try to receive a message via pop3, then immediately send a response to that message and then retieve next message. Here is some sample code that shows the issue:
private void btnCheckandReply_Click(object sender, EventArgs e)
{
Aspose.Network.License AspLicense = new Aspose.Network.License();
AspLicense.SetLicense("Aspose.Total.lic");
Aspose.Network.Pop3.Pop3Client mail = new Pop3Client(txtPopHost.Text, Convert.ToInt32(txtPopPort.Text), txtUserName.Text, txtPassword.Text, SSLCheck);
mail.Connect();
mail.Login();
Aspose.Network.Pop3.Pop3MessageInfoCollection info = new Pop3MessageInfoCollection();
info = mail.ListMessages();
int MessageCount = info.Count;
foreach (Aspose.Network.Pop3.Pop3MessageInfo msg in info)
{
txtResults.Text += msg.Subject + "\r\n";
int msgID = msg.SequenceNumber;
Aspose.Network.Mail.MailMessage eMsg = mail.FetchMessage(msgID);
Aspose.Network.Mail.SmtpClient smtp = new SmtpClient(txtSmtpHost.Text, Convert.ToInt32(txtSmtpPort.Text));
Aspose.Network.Mail.MailMessage mm = new MailMessage("noreply@company.com", "myname@company.com", "testMessage", "TestBody");
smtp.Send(mm);
}
}
The exception I am receiving is "Smtp server returned an invalid response", the strange thing is this exception was during a pop3 operation not a smtp operation. In the above for each loop, everything works the first round (including the send) but fails on the FetchMessage call on the second round (there are 3 messages in the pop3 mailbox).
This pop3 server is an Exhange 2003 server (but I can't use the exchange namespace since I need to maintain compatibility with other pop3 servers), for the SMTP I have tried both a sendmail server as well as the Exhange 2003 server.
Thanks again,
Rick