Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Check Number of Messages on POP3 Server
C++ code to check for email on a POP3 server. // The Chilkat Email library is also available as an ActiveX component
// or .NET class with the identical set of methods and properties.
// Check to see how many emails are on the POP3 server.
void EmailExample(void)
{
CkString str;
CkMailMan mailman;
// Any string passed to UnlockComponent begins the 30-day trial.
bool unlocked = mailman.UnlockComponent("30-day trial");
if (!unlocked)
{
printf("Failed to unlock component\n");
return;
}
mailman.put_MailHost("mail.chilkatsoft.com");
mailman.put_PopUsername("matt");
mailman.put_PopPassword(myPassword);
// Set the POP3 port to the standard MS Exchange Server SSL POP3 port 995
// mailman.put_MailPort(995);
// Tell the mailman to connect to POP3 using SSL
// mailman.put_PopSsl(true);
int numEmailMessages = mailman.CheckMail();
if (numEmailMessages == -1)
{
mailman.LastErrorText(str);
printf("%s",str.getString());
}
else
{
printf("There are %d mail messages on the POP3 server.\n",numEmailMessages);
}
|
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.