Re: Wishlist: com.zms.sendmail should allow for Cc, Bcc
"Thorsten Fox" <[email protected]>
| Newsgroups | gmane.comp.cms.zms.devel |
|---|---|
| Message-ID | <[email protected]> |
Thanks, Gregor, for the further improvement. It will be included, the file here in the group is already changed. Greetings tf --- In [email protected], Gregor Hoffleit <gregor@...> wrote: > > Thorsten, > > thanks for including this. > > How about making send_cc and send_bcc optional parameters? Like this? > > --- send_mail 2008-06-19 16:29:15.000000000 +0200 > +++ send_mail.NEW 2008-06-19 16:34:26.000000000 +0200 > @@ -6,16 +6,16 @@ > from email.Utils import COMMASPACE, formatdate > from email import Encoders > > -def send_mail(send_from, send_to, send_cc, send_bcc, subject, text, files=[], server="localhost"): > +def send_mail(send_from, send_to, subject, text, files=[], server="localhost", send_cc=[], send_bcc=[]): > assert type(send_to)==list > assert type(send_cc)==list > assert type(send_bcc)==list > assert type(files)==list > > msg = MIMEMultipart('related') > msg['From'] = send_from > msg['To'] = COMMASPACE.join(send_to) > - msg['Cc'] = COMMASPACE.join(send_cc) > + if send_cc: msg['Cc'] = COMMASPACE.join(send_cc) > msg['Date'] = formatdate(localtime=True) > msg['Subject'] = subject > msg.preamble = 'This is a multi-part message in MIME format.' > > > Regards, > Gregor Hoffleit