Attach an alternative content representation.
(self, content, mimetype)
| 646 | ] |
| 647 | |
| 648 | def attach_alternative(self, content, mimetype): |
| 649 | """Attach an alternative content representation.""" |
| 650 | if content is None or mimetype is None: |
| 651 | raise ValueError("Both content and mimetype must be provided.") |
| 652 | self.alternatives.append(EmailAlternative(content, mimetype)) |
| 653 | |
| 654 | def _add_bodies(self, msg): |
| 655 | if self.body or not self.alternatives: |