Commit 9d82bbdc authored by Jeffrey Shell's avatar Jeffrey Shell

updated with icon

parent b920982c
...@@ -2,8 +2,8 @@ from Globals import Persistent, HTMLFile, HTML ...@@ -2,8 +2,8 @@ from Globals import Persistent, HTMLFile, HTML
from socket import * from socket import *
import Acquisition, sys, regex, string import Acquisition, sys, regex, string
#$Id: MailForm.py,v 1.3 1997/09/09 16:09:13 jeffrey Exp $ #$Id: MailForm.py,v 1.4 1997/09/09 18:40:34 jeffrey Exp $
__version__ = "$Revision: 1.3 $"[11:-2] __version__ = "$Revision: 1.4 $"[11:-2]
smtpError = "SMTP Error" smtpError = "SMTP Error"
addForm=HTMLFile('MailForm/addMailForm_form') addForm=HTMLFile('MailForm/addMailForm_form')
...@@ -25,6 +25,7 @@ class MailForm(Persistent, Acquisition.Implicit): ...@@ -25,6 +25,7 @@ class MailForm(Persistent, Acquisition.Implicit):
'a mailform...?' 'a mailform...?'
manage=HTMLFile('MailForm/manageMailForm') manage=HTMLFile('MailForm/manageMailForm')
index_html=HTMLFile('MailForm/mailForm') index_html=HTMLFile('MailForm/mailForm')
icon="MailForm/MailForm_icon.gif"
def __init__(self): def __init__(self):
'nothing yet' 'nothing yet'
...@@ -60,16 +61,18 @@ class MailForm(Persistent, Acquisition.Implicit): ...@@ -60,16 +61,18 @@ class MailForm(Persistent, Acquisition.Implicit):
raise MailFormError, "Message missing SMTP Header '%s'" \ raise MailFormError, "Message missing SMTP Header '%s'" \
% requiredHeader % requiredHeader
SendMail(self.smtpHost, self.smtpPort, self.localHost).send( SendMail(trueself.smtpHost, trueself.smtpPort,
trueself.localHost).send(
mfrom=headers['from'], mto=headers['to'], mfrom=headers['from'], mto=headers['to'],
subj=headers['subject'], body=messageText) subj=headers['subject'], body=messageText
)
return getattr(self,self.sentMailTemplate)(self, self.REQUEST, return getattr(self,self.sentMailTemplate)(self, self.REQUEST,
messageText=message) messageText=message)
def trueSend(trueself, self=None, REQUEST=None, **kw): def trueSend(trueself, self=None, REQUEST=None, **kw):
if REQUEST: kw=REQUEST if REQUEST: kw=REQUEST
if not self: self=trueself if self == None: self=trueself
if kw.has_key('d_template'): if kw.has_key('d_template'):
mtemplate = getattr(self, kw['d_template']) mtemplate = getattr(self, kw['d_template'])
else: else:
...@@ -90,6 +93,11 @@ class MailForm(Persistent, Acquisition.Implicit): ...@@ -90,6 +93,11 @@ class MailForm(Persistent, Acquisition.Implicit):
return getattr(trueself,trueself.sentMailTemplate)(self, kw, return getattr(trueself,trueself.sentMailTemplate)(self, kw,
messageText=message) messageText=message)
def kwikHack(self, mfid, REQUEST):
'quick and ugly hack to test da system'
jj=getattr(self, mfid)
return jj.trueSend(self=self, REQUEST=REQUEST)
class SendMail: class SendMail:
def __init__(self, smtpHost, smtpPort, localHost="localhost"): def __init__(self, smtpHost, smtpPort, localHost="localhost"):
self.conn = socket(AF_INET, SOCK_STREAM) self.conn = socket(AF_INET, SOCK_STREAM)
...@@ -171,6 +179,6 @@ def decapitate(message, ...@@ -171,6 +179,6 @@ def decapitate(message,
return headerDict, body return headerDict, body
#$Log: MailForm.py,v $ #$Log: MailForm.py,v $
#Revision 1.3 1997/09/09 16:09:13 jeffrey #Revision 1.4 1997/09/09 18:40:34 jeffrey
#minor fixings #updated with icon
# #
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment