If you run a cPanel dedicated server, and your outgoing SMTP emails are sent from your PHP application code, but not delivering successfully, this could be due to configuration issue with your WHM / CSF firewall.
Even after you have added the outgoing ports 465, 567, and usual SMTP / TLS ports, you are still having this issue?
Then make sure you have checked your WHM > Tweak Settings > Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak) . Turn that off.
When restarting your CSF firewall, you may also see the following message:
WARNING The option “WHM > Tweak Settings > Restrict outgoing SMTP to root, exim, and mailman (FKA SMTP Tweak)” is incompatible with this firewall. The option must be disabled in WHM and the SMTP_BLOCK alternative in csf used instead