Error: "There are 965 email jobs that failed. Check your app.yml and ensure that the mail server settings are correct."

Maybe try looking up the exact domain name that’s failing? So:

host api.discourse.org

You should get something like

api.discourse.org is an alias for corp.discourse.org.
corp.discourse.org has address 64.71.168.251
corp.discourse.org has IPv6 address 2001:470:1:3a8::251