-
Notifications
You must be signed in to change notification settings - Fork 124
Description
我登录了126邮箱,发现select folder报错: Select or examine mailbox failure. 代码如下:
int main()
{
try
{
imaps conn("imap.126.com", 993);
// modify username/password to use real credentials
std::cout << 1 << std::endl;
conn.authenticate("[email protected]", "xxxx", imaps::auth_method_t::LOGIN);
std::cout << 2 << std::endl;
imaps::mailbox_folder fld = conn.list_folders(list());
print_folders(0, fld);
conn.select("TEST");
std::cout << 3 << std::endl;
list messages;
listimaps::search_condition_t conds;
conds.push_back(imaps::search_condition_t(imaps::search_condition_t::ALL));
conn.search(conds, messages, true);
std::cout << 4 << std::endl;
for_each(messages.begin(), messages.end(), [](unsigned int msg_uid){ cout << msg_uid << endl; });
}
catch (imap_error& exc)
{
cout << exc.what() << endl;
}
catch (dialog_error& exc)
{
cout << exc.what() << endl;
}
return EXIT_SUCCESS;
}
我在网上搜了一下,发现python模块imapclient在登陆126邮箱之前需要调用client.id_(parameters={"name": "dwn_mail", "version": "1.0"}), 不知道mailio怎么做到