A
A
Alexander Rychkov2020-04-06 22:02:01
IMAP
Alexander Rychkov, 2020-04-06 22:02:01

Need help setting up a C++/CLI Imap folder?

Hello everyone, I'm working on an email client. I share it in VS2019 C ++ / CLI in fact everything is done (authorization, receiving letters, reading, deleting, sending), but everything works so far through the Inbox folder. The project is made using the notorious chilkat library. The matter is that I cannot come into other folders in any way, on similarity "Outgoing" "Spam" and.
etc. used different names (Sent, INBOX.Sent, INBOX/Sent) and still does not enter, who can tell me what the problem is?

Authorization code:

// Установка сертификата
  imap.put_Ssl(true);
  imap.put_Port(993);

  // Подключение по imap 
  success = imap.Connect(imapC);

  // Авторизация
  success = imap.Login(login, password);
  if (success != true) {
    textBox3->Text += stat + "Ошибка логина или пароля" + "\r\n";
    textBox3->Text += "Проверьте правильность узла IMAP" + "\r\n";
    return;
  }
  else {
    textBox3->Text += stat + "Вы авторизовались" + "\r\n";
  }

  // Выбор imap папки с сообщениями
  success = imap.SelectMailbox("Inbox");
  if (success != true) {
    textBox3->Text += stat + "Ошибка выбора папки" + "\r\n";
    return;
  }
  else {
    textBox3->Text += stat + "Выбор папки по умолчанию" + "\r\n";
  }

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Rychkov, 2020-04-07
@dostoevskiy29

Issue resolved

// Выбор imap папки с сообщениями
      // Yandex
      success = imap.SelectMailbox("Отправленные"); 
      if (success != true) {
        // Gmail.com - Ru
        success = imap.SelectMailbox("[Gmail]/Отправленные");
        if (success != true)
        {
          // Gmail.com - Eng
          success = imap.SelectMailbox("[Gmail]/Sent");
          if (success != true)
          {
            // Mail.ru
            success = imap.SelectMailbox("Sent");
            if (success != true)
            {
              this->Enabled = true;
              return;
            }
          }
        }
      }

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question