Changeset 1640 in products


Ignore:
Timestamp:
Feb 4, 2010 2:05:41 PM (14 years ago)
Author:
kroman0
Message:

Fixed email message charset in Plone4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • quintagroup.plonecomments/trunk/quintagroup/plonecomments/utils.py

    r1626 r1640  
    201201    if args: 
    202202        msg = getMsg(context, template, args) 
    203         p_utils = context.plone_utils 
    204         site_props = context.portal_properties.site_properties 
    205         host = p_utils.getMailHost() 
     203        charset = context.portal_properties.site_properties.getProperty('default_charset', 'utf-8') 
     204        msg = msg.encode(charset) 
     205        host = context.plone_utils.getMailHost() 
    206206        try: 
    207207            host.secureSend(msg, user_email, admin_email, 
     
    209209                            subtype = 'plain', 
    210210                            debug = False, 
    211                             charset = site_props.getProperty('default_charset', 'utf-8')) 
     211                            charset = charset) 
    212212        except smtplib.SMTPRecipientsRefused: 
    213             log.error(_('SMTPRecipientsRefused: Could not send the email' 
     213            log.error(_('SMTPRecipientsRefused: Could not send the email ' 
    214214            'notification. Have you configured an email server for Plone?')) 
    215215 
Note: See TracChangeset for help on using the changeset viewer.