Commit c876b050 authored by Jens Vagelpohl's avatar Jens Vagelpohl

Small corrections

parent 44f0e9ad
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
############################################################################## ##############################################################################
"""SMTP mail objects """SMTP mail objects
$Id: MailHost.py,v 1.68 2002/01/15 04:45:13 jens Exp $""" $Id: MailHost.py,v 1.69 2002/01/15 14:58:37 jens Exp $"""
__version__ = "$Revision: 1.68 $"[11:-2] __version__ = "$Revision: 1.69 $"[11:-2]
from Globals import Persistent, DTMLFile, InitializeClass from Globals import Persistent, DTMLFile, InitializeClass
from smtplib import SMTP from smtplib import SMTP
...@@ -162,7 +162,6 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager): ...@@ -162,7 +162,6 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
"""Looks like the same function as send() - scheduledSend() is nowhere """Looks like the same function as send() - scheduledSend() is nowhere
used in Zope. No idea if it is still needed/used (ajung) used in Zope. No idea if it is still needed/used (ajung)
""" """
headers = extractheaders(messageText) headers = extractheaders(messageText)
if not headers['subject']: if not headers['subject']:
...@@ -198,7 +197,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager): ...@@ -198,7 +197,7 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
security.declarePrivate( '_send' ) security.declarePrivate( '_send' )
def _send( self, headers, body ): def _send( self, headers, body ):
""" Send the message """ """ Send the message """
smtpserver = SMTP( self.smtp_host, self.smtp_port ) smtpserver = SMTP( self.smtp_host, int( self.smtp_port ) )
smtpserver.sendmail( headers['from'], headers['to'], body ) smtpserver.sendmail( headers['from'], headers['to'], body )
smtpserver.quit() smtpserver.quit()
......
...@@ -10,8 +10,8 @@ ...@@ -10,8 +10,8 @@
# FOR A PARTICULAR PURPOSE # FOR A PARTICULAR PURPOSE
# #
############################################################################## ##############################################################################
__rcs_id__='$Id: SendMailTag.py,v 1.14 2002/01/15 04:23:08 jens Exp $' __rcs_id__='$Id: SendMailTag.py,v 1.15 2002/01/15 14:58:37 jens Exp $'
__version__='$Revision: 1.14 $'[11:-2] __version__='$Revision: 1.15 $'[11:-2]
from MailHost import MailBase from MailHost import MailBase
from DocumentTemplate.DT_Util import parse_params,render_blocks from DocumentTemplate.DT_Util import parse_params,render_blocks
...@@ -109,7 +109,7 @@ class SendMailTag: ...@@ -109,7 +109,7 @@ class SendMailTag:
if self.mailhost: if self.mailhost:
mhost=md[self.mailhost] mhost=md[self.mailhost]
elif self.smtphost: elif self.smtphost:
mhost=MailBase( self.smtphost, self.port ) mhost=MailBase( smtp_host=self.smtphost, smtp_port=self.port )
mhost.send(render_blocks(self.section.blocks, md), mhost.send(render_blocks(self.section.blocks, md),
self.mailto, self.mailfrom, self.mailto, self.mailfrom,
......
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