[Tutor] smtp.sendmail and xml?

Terence Lo tlo@aw.sgi.com
Tue Apr 1 18:01:25 2003

hi there i have a question:

I'm trying to get use smtp.sendmail to send mail.

smtp.sendmail(sender, mailinglist, message.getvalue())

Everything appears to work fine if I define
strings sender, mailinglist to be:

sender = "user1@aol.com"
mailinglist = "user2@aol.com"

However, when I fetch the values from XML using xml objectify:

sender = config.mailer.sender.PCDATA
mailinglist = config.mailer.mailinglist.PCDATA

As a sanity test, I even print to screen the vars sender and mailinglist and
they both return user1@aol.com and user2@aol.com respectively.

But strangely enough, when I execute smtp.sendmail(....)

I get the following error:

  File "C:\Python21\lib\smtplib.py", line 494, in sendmail
    (code,resp) = self.data(msg)
  File "C:\Python21\lib\smtplib.py", line 384, in data
    raise SMTPDataError(code,repl)
smtplib.SMTPDataError: (503, 'Need RCPT (recipient)')

Anyone know what the heck I'm doing wrong?

thx in advance.