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

It looks like a problem with the SSL verification. #163

Closed boomer11111111 closed 4 months ago

boomer11111111 commented 4 months ago
          It looks like a problem with the SSL verification.

In the version 0 23 I have imposed the stronger SSL verification by default, which seems to be too much for many email servers. It is fixed in the latest versions. If you still want to stay on 0.23 then you have to change the SSL options by using smtps::ssl_options() with the value dialog::ssl_options_t::verify_none. Let me know whether it fixes the problem.

Originally posted by @karastojko in https://github.com/karastojko/mailio/issues/148#issuecomment-1850034861

boomer11111111 commented 4 months ago

How do you do that, i mean what is the line exactly, because i cant figure it out.

karastojko commented 4 months ago

Try something like

mailio::dialog_ssl::ssl_options_t opts = { boost::asio::ssl::context::sslv23, boost::asio::ssl::verify_none };
smtps conn("smtp.gmail.com", 587);
conn.ssl_options(opts);
conn.authenticate("mailio@gmail.com", "mailiopass", smtps::auth_method_t::START_TLS);