The failure could be caused by a few things. Without seeing the error, the first thing you can try is to disable your anti-virus application, then try again.
If that does not help, check your account settings. You will find those in Menu > Tools > Accounts. The host name you can get from your mail provider, but other than that check you have one of the following port/security policy combinations:
Port 587 = Force usage of SSL/TLS
Port 25 = Use SSL/TLS if available
Port 465 = Use SSL/TLS on special port (legacy)
Port 993 = Use SSL/TLS on special port (legacy)
Port 143 = Use SSL/TLS if available
Port 995 = Use SSL/TLS on special port (legacy)
Port 110 = Use SSL/TLS if available
The underlined ones are the best option for security if your server supports them. SMTP port 465 was reassigned and should no longer be used for SMTP, though many mail providers still recommend and use it.