diff --git a/pyramid_mailer/message.py b/pyramid_mailer/message.py index 6428856..b24907f 100644 --- a/pyramid_mailer/message.py +++ b/pyramid_mailer/message.py @@ -139,6 +139,10 @@ def validate(self): if not (self.recipients or self.cc or self.bcc): raise InvalidMessage("No recipients have been added") + if (self.cc or self.bcc) and not self.recipients: + raise InvalidMessage("Must have at least one direct recipient " + "even if cc or bcc set") + if not self.body and not self.html: raise InvalidMessage("No body has been set")