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 = 'f...@example.com' to_addr = ['b...@example.com', 'xy...@example.com'] bcc_addr = ['s...@example.com', 'e...@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 -- http://mail.python.org/mailman/listinfo/python-list