Might be port and mail server host name also cause this error. Need to check the port details as well. If you are using Gmail means please check the below details as well.
SMTP Host:
smtp.gmail.com.
SMTP Port: 587
(This value is fixed port and host for Gmail)
Could you please check once again.?
If you are using different mail accounts means you need to change the values accordingly.