You may be having TCP timeout or mail server error. Here
is my site's feedback form code, which emails me any user
feedback with an optional return email address. Note the
place where server.set_debuglevel(1) turns on the Python
email debug output if needed:
def ThankYou(self):
if self.feedback != "":
# get the date and time
if os.name == 'posix':
t1, t2, t3 = os.popen3('date')
dateAndTime = t2.readlines()[0][:-1]
else:
t1, t2, t3 = os.popen3('time /T')
time = t2.readlines()[0]
t1, t2, t3 = os.popen3('date /T')
date = t2.readlines()[0]
dateAndTime = date[:-1] + " " + time[:-1]
# email out
fromaddr = ""
if self.request().hasField('ADDRESS'):
fromaddr = self.request().field('ADDRESS')
if fromaddr == "":
fromaddr = "[EMAIL PROTECTED]"
toaddrs = ["[EMAIL PROTECTED]"]
# Add the From: and To: headers at the start!
msg = ("From: %srnTo: %srnSubject: Site Feedback Formrnrn"
% (fromaddr, string.join(toaddrs, ", ")))
msg += dateAndTime + "nn"
msg += self.feedback
server = smtplib.SMTP('localhost')
#server.set_debuglevel(1) # for command-line debugging
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
s = '<CENTER>Thank you for your feedback.n'
s += 'Close this window to return to ZunZun.comn'
s += '</CENTER>n'
return s
> Date: Fri, 10 Oct 2003 21:40:02 -0700 (PDT)
> From: Uzo Uzo <[EMAIL PROTECTED]>
> Subject: [Webware-discuss] sending email locking my application
>
> Has anyone here implemented an application that sends email,
> how do you handle sending of the email, right now, I am
> thinking of an alternate implementation, dumping the
> mail and from/to info in a file and having a seperate
> non webware process checking my dump directory and
> mailing out the files.
>
> Uzo
-------------------------------------------------------
This SF.net email is sponsored by: SF.net Giveback Program.
SourceForge.net hosts over 70,000 Open Source Projects.
See the people who have HELPED US provide better services:
Click here: http://sourceforge.net/supporters.php
_______________________________________________
Webware-discuss mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/webware-discuss