I've installed Django any mail and am I trying to use mail gun with it for password resets. I've added any mail to my installed apps and tried to use mail gun as an API or smtp service. Both return back 401 forbidden
For using mail guns API here's my code:
EMAIL_BACKEND = "anymail.backends.mailgun.EmailBackend"
ANYMAIL_MAILGUN_API_KEY = config("MAIL_GUN_DOMAIN_API")
For MAIL_GUN_DOMAIN_API I tried using my accounts private key and I tried creating a domain and using the domains sending key. Both returned the same response.
for smtp :
EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.mailgun.org'
EMAIL_PORT = 465
EMAIL_HOST_USER = config('MAIL_GUN_USERNAME')
EMAIL_HOST_PASSWORD = config('MAIL_GUN_SMTP_PASSWORD')
EMAIL_USE_TLS = True
for MAIL_GUN_USERNAME I used my domains login for MAIL_GUN_SMTP_PASSWORD I used my domains password I tried all of mailguns different ports and switching between tls and ssl none of this worked.
Any ideas what I'm doing wrong?