diff --git a/django_mailbox/models.py b/django_mailbox/models.py index d98ba1fd..e5027536 100644 --- a/django_mailbox/models.py +++ b/django_mailbox/models.py @@ -655,6 +655,9 @@ def reply(self, message): pre-set it. """ + if not isinstance(message, EmailMessage): + raise ValueError('Message must be an instance of EmailMessage') + if not message.from_email: if self.mailbox.from_email: message.from_email = self.mailbox.from_email