Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
d4d0ea4f
Commit
d4d0ea4f
authored
Jun 19, 2000
by
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Merged MailHost.send fixes from 2.2 branch
parent
25080b96
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
9 deletions
+13
-9
lib/python/Products/MailHost/MailHost.py
lib/python/Products/MailHost/MailHost.py
+10
-6
lib/python/Products/MailHost/SendMailTag.py
lib/python/Products/MailHost/SendMailTag.py
+3
-3
No files found.
lib/python/Products/MailHost/MailHost.py
View file @
d4d0ea4f
...
...
@@ -84,8 +84,8 @@
##############################################################################
"""SMTP mail objects
$Id: MailHost.py,v 1.5
3 2000/06/19 18:51:58
brian Exp $"""
__version__
=
"$Revision: 1.5
3
$"
[
11
:
-
2
]
$Id: MailHost.py,v 1.5
4 2000/06/19 19:52:26
brian Exp $"""
__version__
=
"$Revision: 1.5
4
$"
[
11
:
-
2
]
from
Globals
import
Persistent
,
HTMLFile
,
HTML
,
MessageDialog
from
smtplib
import
SMTP
...
...
@@ -122,6 +122,8 @@ def add(self, id, title='', smtp_host=None,
if
REQUEST
is
not
None
:
REQUEST
[
'RESPONSE'
].
redirect
(
self
.
absolute_url
()
+
'/manage_main'
)
import
pdb
class
MailBase
(
Acquisition
.
Implicit
,
OFS
.
SimpleItem
.
Item
,
RoleManager
):
'a mailhost...?'
meta_type
=
'Mail Host'
...
...
@@ -199,15 +201,17 @@ class MailBase(Acquisition.Implicit, OFS.SimpleItem.Item, RoleManager):
def
send
(
self
,
messageText
,
mto
=
None
,
mfrom
=
None
,
subject
=
None
,
encode
=
None
):
# pdb.set_trace()
headers
=
extractheaders
(
messageText
)
if
not
headers
[
'subject'
]:
messageText
=
"subject: %s
\
n
%s"
%
(
subject
or
'[No Subject]'
,
messageText
=
"subject: %s
\
n
\
n
%s"
%
(
subject
or
'[No Subject]'
,
messageText
)
if
mto
:
if
type
(
mto
)
is
type
(
's'
):
mto
=
map
(
string
.
strip
,
string
.
split
(
mto
,
','
))
headers
[
'to'
]
=
filter
(
truth
,
mto
)
headers
[
'to'
]
=
filter
(
None
,
mto
)
if
mfrom
:
headers
[
'from'
]
=
mfrom
...
...
@@ -285,5 +289,5 @@ def extractheaders(message):
hd
[
'to'
].
append
(
addr
)
hd
[
'from'
]
=
mo
.
getaddr
(
'from'
)[
1
]
hd
[
'subject'
]
=
mo
.
getheader
(
'subject'
)
or
"No Subject"
hd
[
'subject'
]
=
mo
.
getheader
(
'subject'
)
or
''
return
hd
lib/python/Products/MailHost/SendMailTag.py
View file @
d4d0ea4f
...
...
@@ -82,8 +82,8 @@
# attributions are listed in the accompanying credits file.
#
##############################################################################
__rcs_id__
=
'$Id: SendMailTag.py,v 1.
7 1999/11/03 16:09:14
brian Exp $'
__version__
=
'$Revision: 1.
7
$'
[
11
:
-
2
]
__rcs_id__
=
'$Id: SendMailTag.py,v 1.
8 2000/06/19 19:52:26
brian Exp $'
__version__
=
'$Revision: 1.
8
$'
[
11
:
-
2
]
from
MailHost
import
MailBase
from
DocumentTemplate.DT_Util
import
*
...
...
@@ -94,7 +94,7 @@ import string
class
SendMailTag
:
'''the send mail tag, used like thus:
<dtml-sendmail
someMailHostID
>
<dtml-sendmail
mailhost="someMailHostID"
>
to: person@their.machine.com
from: me@mymachine.net
subject: just called to say...
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment