Sheila King sheila at
Thu Oct 25 15:43:00 CEST 2001

On 25 Oct 2001 13:56:26 +0100, -$Paul$- at (Paul
Wright) wrote in comp.lang.python in article
<9r925q$863$1 at>:

:- Some ISPs transparently redirect outgoing SMTP connections to their
:  own mail server. So you're program will probably still work in those
:  cases.

This is what AOL does, and yet his program didn't work. However...
with AOL, even though you use a non-AOL address in the From: field, it
adds some "apparently-from:" header to the email, with your AOL address
in it. Is it possible, that he wasn't 'logged-on' as an AOL userid, and
so the addy got refused as a bad sender? (He got
SMTPSenderRefused error, which sounds like it was complaining about the
From: address ? Actually, now that I think about it, it would be
complaining about the sender in the SMTP envelope. I wonder if he
changed that to the correct AOL logon id, if his program would now work,
even though he left the sender in as the mail server. What
should happen at AOL, is that even though you designate the earthlink
mail server, it will quietly intercept and send through their own server

Try changing the address in the SMTP envelope.
(i.e. the sender of the SMTP envelope doesn't have to be the same as the
From: header in the message itself).

Try this:
Add an additional prompt after From:

fromaddr = prompt("From: ")
sender = prompt("SMTP Sender: ")

I would try the user's AOL logon id for the sender?

And change this line:
server.sendmail(fromaddr, toaddrs, msg)

To this:
server.sendmail(sender, toaddrs, msg)

And see if you can send through AOL using that code?

Still, the best thing is to let the user also specify his own SMTP
server. I'm not sure why you aren't letting the user configure that for

Sheila King

More information about the Python-list mailing list