I recently had a similar issue with testing on mailtrap.io
if on cPanel using ConfigServer Security & Firewall, you will need to allow your domains user ID to bypass the SMTP block in the config file
SMTP_BLOCK
Note: root (UID:0) is always allowed