Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Check for Email on a POP3 Server
C# source code to check for email on a POP3 server. private void button1_Click(object sender, System.EventArgs e)
{
Chilkat.MailMan mailman = new Chilkat.MailMan();
mailman.UnlockComponent("UnlockCode");
mailman.MailHost = "mail.chilkatsoft.com";
mailman.PopUsername = "myLogin";
mailman.PopPassword = "myPassword";
// CheckMail returns an integer value equal to the number
// of mail messages in the POP3 mailbox.
// If CheckMail failed, a value of -1 is returned.
// A failure can occur if the username/password is incorrect,
// or the mail server is unreachable, etc.
long numMessages = mailman.CheckMail();
textBox1.Text = Convert.ToString(numMessages);
if (numMessages == -1)
{
MessageBox.Show(mailman.LastErrorText);
}
}
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.