Generally, when you create an account on a hosting, an e-mail account is created that will be used to make the SMTP connection. If you do not have this account, or do not know which account this is, I recommend you to contact the hosting.
Or if you have access to the administrative panel, such as CPanel, you can even create / see what the account is. Some hosts use ports 587, 25, or 2525 for SMTP, you should see with your hosting what it would be.
One of the things that can go wrong, I do not know if it's your case, but it's the SMTP host issue, it's usually a different one from your domains, many times it's mail.yourdomain.com. Check with the company this too.
Another thing, to use the mail function, you have to make some settings, like for example.
php_flag authmail.debug: Enables system error messages.
php_value authmail.port: Sets the port that will be used for sending (587).
php_value authmail.address: The e-mail address that will be used.
php_value authmail.account: User access to the e-mail account.
php_value authmail.smtp: E-mail sending server.
php_value authmail.password: Password for access to the email account.
All this information is in a .htaccess file in the root folder.
Read these links, you can help.
link
link
valew.