Opened 18 years ago

Closed 17 years ago

#3307 closed enhancement (fixed)

Implement BCC in the mail framework

Reported by: James Bennett Owned by: Adrian Holovaty
Component: Core (Mail) Version:
Severity: normal Keywords: mail, bcc
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


Django's built-in send_mass_mail is nice, but it's lacking two features which would make it even nicer (especially for folks who manage newsletters or other types of mailing lists):

  1. It can't handle multipart messages, which rules out sending HTML and plain-text versions of the same message.
  2. It doesn't do anything to hide the email addresses of the recipients, which is a no-no for newsletters.

So here's a proposal:

  1. Have send_mass_mail look at the message part of each datatuple; if the message is a list or tuple, send multipart with the first element being the plain-text and the second being the HTML.
  2. Add a new optional keyword argument -- suppress_recipients -- which defaults to False (for backwards compatibility) but, if True, uses only the 'first' address in recipient_list in the To: field (so the first supplied address can be a mailing-list address or other screen) and the rest will go into the Bcc: field.

Attachments (2)

mail.diff (4.0 KB ) - added by James Bennett 18 years ago.
Patch which implements this proposal
only_suppress_recipients.diff (2.8 KB ) - added by mssnlayam@… 18 years ago.
Patch with only suppress_recipients

Download all attachments as: .zip

Change History (11)

by James Bennett, 18 years ago

Attachment: mail.diff added

Patch which implements this proposal

comment:1 by James Bennett, 18 years ago

Summary: Add some extra functionality to django.core.mail.send_mass_mail[patch] Add some extra functionality to django.core.mail.send_mass_mail

comment:2 by Russell Keith-Magee, 18 years ago

Point 1 is a duplicate of #1541.

comment:3 by James Bennett, 18 years ago

Hmm. I thought I'd searched on this previously and not found anything, but I guess I was wrong. #1541 has a safer implementation of the multipart stuff.

comment:4 by Chris Beaven, 18 years ago

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

Ubernostrum (or someone), could you make a new patch to just provide the suppress_recipients enhancement? Perhaps as a new ticket and then this can be closed as a dupe of that and #1541.

by mssnlayam@…, 18 years ago

Patch with only suppress_recipients

comment:5 by Gary Wilson <gary.wilson@…>, 17 years ago

To me it would seem more natural and flexible to have a recipient_list and optional bcc_list in the datatuple.

comment:6 by bruce@…, 17 years ago

Please see discussion at #1541.

comment:7 by Simon G. <dev@…>, 17 years ago

Component: Core frameworkdjango.core.mail
Keywords: mail bcc added
Summary: [patch] Add some extra functionality to django.core.mail.send_mass_mailImplement BCC in the mail framework

I'm changing this ticket to focus on the suppress recipients issue. Please continue discussion of the multipart message implementation at #1541.

I also agree with Gary here regarding the recipient_list/bcc_list issue, IMO that's more logical.

comment:8 by Simon G. <dev@…>, 17 years ago

Triage Stage: AcceptedDesign decision needed

comment:9 by Malcolm Tredinnick, 17 years ago

Resolution: fixed
Status: newclosed

(In [5146]) Fixed #3307 -- Added BCC support to the EmailMessage class. En-passant, fixed a
number of RST formatting errors in the email docs.

Note: See TracTickets for help on using tickets.
Back to Top