karastojko / mailio

mailio is a cross platform C++ library for MIME format and SMTP, POP3 and IMAP protocols. It is based on standard C++ 17 and Boost library.
Other
372 stars 98 forks source link

smtps::connection::submit response #144

Closed C0D3RED closed 11 months ago

C0D3RED commented 11 months ago

Why am I receiving status code 200 response from gmail smtps server if receipent email does not exists?

            try
            {
                mailio::smtps connection{m_config->host, m_config->port};
                connection.authenticate(m_config->email, m_config->password,mailio::smtps::auth_method_t::START_TLS);
                auto response = connection.submit(msg);

                std::cout << response << '\n';
            }
            catch (const std::runtime_error& ex)
            {
                std::cout << ex.what() << '\n';
            }
karastojko commented 11 months ago

Because an SMTP server does not check recipients on sending. The email infrastructure is quite different comparing to, for instance, IM server.

C0D3RED commented 11 months ago

Understood, thank you