I don’t think the OP’s accessing the database by the IP address; he was trying to connect to a supposed SMTP server (hence the port 465 for SSL/TLS connections) at localhost which doesn’t work as free hosting web servers don’t have any mail server on; plus SMTP connections to external mail services only work with STARTTLS and port 587.
@TIzzy01, since you were trying to configure a SMTP server, you might have to use an external one instead of an internal one; here’s a guide to use Gmail’s SMTP service:
To configure it with your software, there should already be a DSN for Gmail they already created for you to use; here is its documentation: