smtplib --> receiving emails two times

Tim Roberts timr at probo.com
Fri Jan 26 01:53:01 EST 2001


Toralf Wittner <wittner at fossilverlag.de> wrote:

>Hi Python coders,
>
>I try to collect data from a HTML formular via cgi and email the stuff to a 
>certain address. The script is as follows:
>...
>This works basically, however all emails are received two times wich is 
>annoying at least . I can't see why this happens 

Me, either offhand.  Is it possible your script is getting executed twice
for some readon?  You didn't give us the HTML from the calling page.

You might try creating a log file.  I find that to be a good way to debug
my CGI scripts:

def Log(msg):
  f = open('/tmp/log','a')
  # Might want to prepend date/time.
  f.write(msg)
  f.close()

Log( "I got here" )
...
Log( "Recipient is %s" % to_address )
--
- Tim Roberts, timr at probo.com
  Providenza & Boekelheide, Inc.



More information about the Python-list mailing list