On 30/03/07, Boudreau, Emile <[EMAIL PROTECTED]> wrote:
>
> 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,
You are passing the TO addresses as 3 addresses in a single string.
[TO] results in a list containing a single string - not a list
containing 3 individual addresses.
You need to either pass the addresses to the function as a list
containing the 3 addresses as individual strings, or change
[TO]
to
TO.split(',')
HTH :)
--
http://mail.python.org/mailman/listinfo/python-list