mail::account::checkNewMail
Prev | mail::account Native API reference | Next

## Name

mail::account::checkNewMail — Check for new mail

## Synopsis

#include <libmail/mail.H>
class myCallback : public mail::callback {
public:
void success(std::string msg);
void fail(std::string msg);
};

mail::account *account;

`account->checkNewMail(` | myCallback &callback`)`;

## USAGE

This request checks for new messages in the currently open folder. With some accounts this request also checks for any messages that were removed from the folder by another process or application.

## RETURN CODES AND CALLBACKS

The application must wait until `callback`'s `success` or `fail` method is invoked. The `success` method is invoked when this request is succesfully processed. The `fail` method is invoked if this request cannot be processed. The application must not destroy `callback` until either the `success` or `fail` method is invoked.

### Note

`callback`'s `fail` method may be invoked even after other callback methods were invoked. This indicates that the request was partially completed before the error was encountered.

This request may result in additional callback methods invoked before the `success` method is invoked. The currently opened folder's callback::folder's object's `newMessages` method will be invoked if the current folder has any new messages. The `messagesRemoved` and `messageChanged` methods may also be invoked.

Prev | Up | Next
mail::account Native API reference | Home | ToC | mail::account::copyMessagesTo