The most common reason for a connection refused with and MQTT client is that it cannot reach the server itself.
Where is the MQTT server located? Is it on a machine in your own network or on a public machine?
If it is on your own network are you using the public IP or the internal IP? If the public IP have you setup forwarding rules on your router?
Do you have authentication on the MQTT connection?
What port is the MQTT listening on and has that been specified correctly in the connection details?
Is your MQTT setup to use https (SSL)? If so are you using a self signed certificate or a purchased certificate?