It looks more like a network problem than a library problem.
The error message says it can't connect to the the SMTP server, so this suggests an issue between your app and the mail server. Try the following.
Good luck!
I changed the network and the issue is resolved but getting another error as below