|
|||
|
Hi!
I wanna ask that have anyone some experience with email.msg and smtplib? The email message and smtp.send already have "sender/from" and "recip/addr to". Possible the smtp components does not uses the email tags if I not define them only in the message? Can I do same thing as in GMAIL that the mail does not have TO, only BCC tags/recipients, and no one of the recipients who knows about the each others? Thanks: dd |
|
|
||||
|
||||
|
|
|
|||
|
durumdara schreef:
> Hi! > > I wanna ask that have anyone some experience with email.msg and smtplib? > > The email message and smtp.send already have "sender/from" and > "recip/addr to". > Possible the smtp components does not uses the email tags if I not > define them only in the message? smtplib.SMTP.sendmail() does not look in the message to find the sender or recipients; it only uses the parameters you pass. > Can I do same thing as in GMAIL that the mail does not have TO, only BCC > tags/recipients, and no one of the recipients who knows about the each > others? Include the BCC-recipients in the call to sendmail(), but don't put them in the email message itself. Include TO-recipients in both. In other words, what you put in the TO-header is what all recipients will see; what you pass to sendmail() is what recipients the mail will be send to. Simple example (not tested): from_addr = 'foo@example.com' to_addr = ['bar@example.com', 'xyzzy@example.com'] bcc_addr = ['spam@example.com', 'eggs@example.com'] msg = """From: %s To: %s Subject: test hello """ % (from_addr, ', '.join(to_addr)) smtp = smtplib.SMTP(...) smtp.sendmail(from_addr, to_addr + bcc_addr, msg) -- The saddest aspect of life right now is that science gathers knowledge faster than society gathers wisdom. -- Isaac Asimov Roel Schroeven |
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Re: sorting temporary arrays | Jack Hamilton | Newsgroup comp.soft-sys.sas | 0 | 01-31-2009 05:09 AM |
| Re: sorting temporary arrays | Ian Whitlock | Newsgroup comp.soft-sys.sas | 0 | 01-31-2009 02:49 AM |
| need help in Sending graph in mail body | gurtej | Newsgroup comp.soft-sys.sas | 1 | 03-27-2007 07:10 PM |
| Re: email to mail lists | F. J. Kelley | Newsgroup comp.soft-sys.sas | 0 | 12-23-2004 08:42 PM |