Issue with sending mails to outlook [Update]

Hello there, I’m facing an issue with sending emails to an Outlook email, when I attach a pdf file in the email, but It works fine with Gmail accounts, here is my mailgun config in the settings.py

EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
EMAIL_HOST = 'smtp.eu.mailgun.org'
EMAIL_PORT = 587  
EMAIL_HOST_USER = 'postmaster@smartovate.com'
EMAIL_HOST_PASSWORD = '9a5c5bb9f50b8d***********'
DEFAULT_FROM_EMAIL = 'postmaster@smartovate.com'
MAILGUN_DOMAIN = 'smartovate.com'
MAILGUN_API_KEY = 'pubkey-572f48****'

And I’m using the EmailMessage class for this

email = EmailMessage(
            subject='Invoice PDF',
            body=message,
            from_email=settings.DEFAULT_FROM_EMAIL,
            to=["finance@smartovate.com",
                "work_email@caustaza.com",
                "personel_email@gmail.com"
                ]
        )

# ok the issue is here, when I attach a file (In my case pdf) the email is not being sent to outlook, but it works fine with gmail
email.attach(f'invoice_{invoice_id}.pdf', buffer.getvalue(), 'application/pdf')

If anyone has faced this issue before and he manages to solve it, please inform us

Thank you

Please be more specific. What exactly is the issue you’re facing?

Do you have any logs available to you from mailgun that can show you the results of the email being sent?

Generally speaking, if you can’t send an email to one specific domain or address, the cause of the issue is on their end, and there’s nothing you can do about it.

Yes, that’s what i thought, Thanks I will double check the configuration and read more about this