Hello all, I'm trying to send a results email to 3 people. For some
reason only the first person in the list will receive the email but in
the received email it shows the 3 addresses. Here is my code, can
someone show me where I'm going wrong?? Thanks

sendMail('this is the subject line', 'the results: 71 fails, 229 pass,
300 total.', '[EMAIL PROTECTED], [EMAIL PROTECTED],
[EMAIL PROTECTED]')

def sendMail(subject, body, TO, FROM="[EMAIL PROTECTED]"):
    print TO
    HOST = "exchange.mycompany.com"
    BODY = string.join((
        "From: %s" % FROM,
        "To: %s" % TO,
        "Subject: %s" % subject,
        "",
        body
        ), "\r\n")
    server = smtplib.SMTP(HOST)
    server.sendmail(FROM, [TO], BODY)
    server.quit()

Emile Boudreau
 
     This message may contain privileged and/or confidential information.  If 
you have received this e-mail in error or are not the intended recipient, you 
may not use, copy, disseminate or distribute it; do not open any attachments, 
delete it immediately from your system and notify the sender promptly by e-mail 
that you have done so.  Thank you.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to