Changeset 1161 in products for qPloneComments/branches/jcbrand-abuseFeature/utils.py
- Timestamp:
- Jul 24, 2009 11:08:58 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
qPloneComments/branches/jcbrand-abuseFeature/utils.py
r943 r1161 1 import logging 2 import smtplib 1 3 from Products.CMFPlone import MessageFactory 2 4 from Products.CMFCore.utils import getToolByName 5 from Products.CMFPlone import PloneMessageFactory as _ 6 7 log = logging.getLogger('Products.qPloneComments.utils.py') 3 8 4 9 # Get apropriate property from (propery_sheeet) configlet … … 201 206 site_props = context.portal_properties.site_properties 202 207 host = p_utils.getMailHost() 203 host.secureSend(msg, user_email, admin_email, 204 subject = subject, 205 subtype = 'plain', 206 debug = False, 207 charset = site_props.getProperty('default_charset', 'utf-8'), 208 From = admin_email) 208 try: 209 host.secureSend(msg, user_email, admin_email, 210 subject = subject, 211 subtype = 'plain', 212 debug = False, 213 charset = site_props.getProperty('default_charset', 'utf-8'), 214 From = admin_email) 215 except smtplib.SMTPRecipientsRefused: 216 log.error(_('SMTPRecipientsRefused: Could not send the email' 217 'notification. Have you configured an email server for Plone?')) 218 219 209 220 210 221 def setStatusMsg(state, context, msg):
Note: See TracChangeset
for help on using the changeset viewer.