diff --git a/django_mailbox/models.py b/django_mailbox/models.py index e5027536..95a9fccf 100644 --- a/django_mailbox/models.py +++ b/django_mailbox/models.py @@ -654,9 +654,16 @@ def reply(self, message): to retrieve that information through normal channels, so we must pre-set it. + For conveninence, you can use django.core.mail.EmailMessage to build a Message instance:: + + from django.core.mail import EmailMessage + + message.reply( + EmailMessage(subject="pong", body="pongpong") + ) """ if not isinstance(message, EmailMessage): - raise ValueError('Message must be an instance of EmailMessage') + raise ValueError('Message must be an instance of email.Message') if not message.from_email: if self.mailbox.from_email: diff --git a/docs/topics/mailbox_types.rst b/docs/topics/mailbox_types.rst index 6fabf768..349986ef 100644 --- a/docs/topics/mailbox_types.rst +++ b/docs/topics/mailbox_types.rst @@ -7,20 +7,20 @@ POP3 and IMAP as well as local file-based mailboxes. .. table:: 'Protocol' Options - ============ ================ ==================================================================================================================================================================== - Mailbox Type 'Protocol':// Notes - ============ ================ ==================================================================================================================================================================== - POP3 ``pop3://`` Can also specify SSL with ``pop3+ssl://`` - IMAP ``imap://`` Can also specify SSL with ``imap+ssl://`` or STARTTLS with ``imap+tls``; additional configuration is also possible: see :ref:`pop3-and-imap-mailboxes` for details. - Gmail IMAP ``gmail+ssl://`` Uses OAuth authentication for Gmail's IMAP transport. See :ref:`gmail-oauth` for details. - Office365 API``office365://`` Uses OAuth authentication for Office365 API transport. See :ref:`office365-oauth` for details. - Maildir ``maildir://`` - Mbox ``mbox://`` - Babyl ``babyl://`` - MH ``mh://`` - MMDF ``mmdf://`` - Piped Mail *empty* See :ref:`receiving-mail-from-exim4-or-postfix` - ============ ================ ==================================================================================================================================================================== + ================ ================ ==================================================================================================================================================================== + Mailbox Type 'Protocol':// Notes + ================ ================ ==================================================================================================================================================================== + POP3 ``pop3://`` Can also specify SSL with ``pop3+ssl://`` + IMAP ``imap://`` Can also specify SSL with ``imap+ssl://`` or STARTTLS with ``imap+tls``; additional configuration is also possible: see :ref:`pop3-and-imap-mailboxes` for details. + Gmail IMAP ``gmail+ssl://`` Uses OAuth authentication for Gmail's IMAP transport. See :ref:`gmail-oauth` for details. + Office365 API ``office365://`` Uses OAuth authentication for Office365 API transport. See :ref:`office365-oauth` for details. + Maildir ``maildir://`` *empty* + Mbox ``mbox://`` *empty* + Babyl ``babyl://`` *empty* + MH ``mh://`` *empty* + MMDF ``mmdf://`` *empty* + Piped Mail *empty* See :ref:`receiving-mail-from-exim4-or-postfix` + ================ ================ ==================================================================================================================================================================== .. warning:: @@ -117,6 +117,7 @@ Build your URI accordingly:: .. _office365-oauth: + Office 365 API -------------------------------------