Closed Maurizio1 closed 1 year ago
Are you sure that the hostname is like pop3s.xxxx.it
? Usually the hostnames are like pop.gmail.com
and pop.mail.yahoo.com
(no S at the end of "pop"), while the port number (110 or 995) determines whether it is plain or SSL connection.
Thanks for the prompt reply. Yes, I'm sure, I also use the mailbox from Outlook.
I do not know does your particular server support SSL login or STARTTLS or both. Can you please try with the STARTTLS option and check whether it works or not?
It's the server of my provider and it looks like it usese just SSL/TLS. Anyway I could not figure out how to make it working by using the STARTTLS option, but it worked like a charm with the following instructions: `mailio::pop3s conn("pop3s.myserver.it", 995);
mailio::dialog_ssl::ssl_options_t ssl_options;
ssl_options.method = boost::asio::ssl::context::tls_client;
conn.ssl_options(ssl_options);
std::string answer = conn.authenticate("myaccount@mydomain.it", "mypassword", mailio::pop3s::auth_method_t::LOGIN);`
Thank you very much for the library and your support.
Maurizio
Interesting, do you have to set the same TLS optiom for SMTP and IMAP?
Did not try because I was interested just on POP3, but I will try and let you know...
Yes, I can confirm that for POP3, IMAP and SMTP I can successfully connect to mail server only if I set the ssl options:
`mailio::dialog_ssl::ssl_options_t ssl_options;
ssl_options.method = boost::asio::ssl::context::tls_client;
ssl_options.verify_mode = boost::asio::ssl::verify_none;
conn.ssl_options(ssl_options);`
Thanks for the info.
Hi,
I'm using:
mailio::pop3s conn("pop3s.xxxxx.it", 995); conn.authenticate("myname@mydomain.it", "mypassword", mailio::pop3s::auth_method_t::LOGIN);
to connect to mail server. I get the error:Caught exception while connecting: Switching to SSL failed.
Any advice on where to look, OpenSSl version, Boost library linker include, server configuration, etc...? (no SSL connection using mailio::pop3 on port 110 works as espected)
Thank you in advance!
Maurizio