Due to security reasons, we do not support Third Party SMTP
We strongly suggest using our own SMTP server for mailing, we know that it is not at all an acceptable move for the developer community but for the safety of the server we have to apply it.
This code may help you.
Mail Host = mail.mydomain.com
Mail Port = 465
There are the majority of SMB websites that run on CMS such as
WordPress
Joomla
WHMCS
and others. Most of these CMS software is inbuilt configured to send emails from themselves
These emails can be sent for various purposes – such as
Order confirmations
Invoice delivery
Contact form submissions
Password resets
Account registration and so on
Why is SMTP Blocked By Many Web Hosts? Web hosts often block SMTP ports to prevent bad actors from sending spam to other users