In the previous topic : Magento 2 smtp could not open socket
I encounter the same issue ,and i tried to do the same solution provided by Dhiren Vasoya.
which is adding code to magento 's abstract.php.but i issue did not resolve and it gives me
(Could not open socket: stream_socket_client(): unable to connect to tcp://email-smtp.us-east-1.amazonaws.com:587 (Connection timed out) )
I also tried on gmail smtp using ssl socket as configuration,doesnt work.
Would it be magento version? because i m using 2.3.1,or something else is missing? like openssl configuration?