Changeset 7404 for main/waeup.sirp/trunk/src/waeup/sirp/utils
- Timestamp:
- 20 Dec 2011, 09:33:10 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7402 r7404 41 41 from_addr = from_addr.encode('ascii') 42 42 rpct_addr = rcpt_addr.encode('ascii') 43 44 43 for body_charset in ['US-ASCII', 'ISO-8859-1', 'UTF-8']: 45 44 try: 46 45 body.encode(body_charset) 47 46 except UnicodeError: 48 print "FAILED: ", body_charset, body47 #print "FAILED: ", body_charset, body 49 48 pass 50 49 else: 51 50 break 52 53 51 msg = MIMEText(body.encode(body_charset), 'plain', body_charset) 54 52 msg['From'] = formataddr((from_name, from_addr)) … … 72 70 grok.implements(ISIRPUtils) 73 71 74 def send Mail(self,from_name,from_addr,rcpt_name,rcpt_addr,72 def sendContactForm(self,from_name,from_addr,rcpt_name,rcpt_addr, 75 73 from_username,usertype,portal,body,subject): 76 74 """Send an email with data provided by forms.
Note: See TracChangeset for help on using the changeset viewer.