I’d start by asking where you’re hosting. Hosting providers are notorious for blocking outbound SMTP as an anti-spam strategy.
Wait… hang on. You appear to have a mixture of the API settings and the SMTP settings.
Mailgun credential setting (SMTP route, susceptible to hosting provider blocks) are here:
And here’s the API version (won’t be blocked by your host)
I’d pick one method (preferably API-based), confirm values for that method, strip out the unneeded bits, and see if that resolves it. If it doesn’t, check your Ghost logs and your Mailgun logs.