I'm making a modification in my program that uses Mail.dll. Here in company, we've changed from Gmail to Office365, and now I'm adapting the program. I've did the modifications, looks like the Mail.dll sucessiful connect, but when I perform the Imap.Search method, there's no return.
My Gmail code:
public MailRep(string host, int port, string login, string pass) {
imap.ConnectSSL(host, port);
imap.UseBestLogin(login, pass);
// imap.SelectInbox(); <-- this is not needed
CommonFolders common = new CommonFolders(imap.GetFolders());
imap.Select(common.AllMail);
List<long> idSelecao = imap.Search().Where(
Expression.GmailRawSearch(criteria));
..
}
When I changed to Office365, after connect, he shows me NullPointerException in this command:
imap.Select(common.AllMail);
I've ripped off this lines from code, but the problem still remais in the Search method.
Can you help me please?