Changeset 7400 for main/waeup.sirp/trunk/src/waeup
- Timestamp:
- 20 Dec 2011, 08:09:38 (13 years ago)
- Location:
- main/waeup.sirp/trunk/src/waeup/sirp
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
main/waeup.sirp/trunk/src/waeup/sirp/browser/browser.txt
r7383 r7400 50 50 >>> browser.getControl(name='form.fullname').value = "Bob Tester" 51 51 >>> browser.getControl(name='form.email_from').value = "xx@yy.zz" 52 >>> browser.getControl(name='form.body').value = "test message with umlaut ä"52 >>> browser.getControl(name='form.body').value = u'test message with umlaut ä' 53 53 >>> browser.getControl('Send').click() 54 54 >>> print browser.contents -
main/waeup.sirp/trunk/src/waeup/sirp/utils/utils.py
r7399 r7400 29 29 30 30 def send_mail(from_name,from_email,rcpt_name,rcpt_email,subject,body,config): 31 """ 32 XXX: While this method is unicode-proof (i.e. it can handle 33 non-plain-ASCII chars in names and messages) other 34 methods inhere are not and will fail silently. Some 35 reorganization of SMPT-related code is needed here. 36 """ 31 37 32 38 header_charset = 'ISO-8859-1' … … 44 50 body.encode(body_charset) 45 51 except UnicodeError: 46 print "FAILED: ", body_charset, text52 print "FAILED: ", body_charset, body 47 53 pass 48 54 else: … … 82 88 %s 83 89 """ 84 msg = MIMEText(text % (fullname,username,usertype,portal,body)) 85 msg['From'] = '%s <%s>' % (fullname,email_from) 86 msg['To'] = email_to 87 msg['Subject'] = subject 88 server = smtplib.SMTP(config.smtp_server) 89 if config.smtp_requires_login: 90 server.login(config.smtp_username,config.smtp_password) 91 try: 92 server.sendmail(email_from,email_to,msg.as_string()) 93 except: 94 return False 95 server.quit() 96 return True 90 from_name = fullname 91 from_email = email_from 92 rcpt_name = 'xyz' 93 rcpt_email = email_to 94 body = text % (fullname,username,usertype,portal,body) 95 return send_mail( 96 from_name,from_email,rcpt_name,rcpt_email,subject,body,config) 97 97 98 98 def fullname(self,firstname,lastname,middlename=None): … … 116 116 117 117 Returns True or False to indicate successful operation. 118 119 XXX: While this method is unicode-proof (i.e. it can handle120 non-plain-ASCII chars in names and messages) other121 methods inhere are not and will fail silently. Some122 reorganization of SMPT-related code is needed here.123 118 """ 124 119 username = applicant.applicant_id
Note: See TracChangeset for help on using the changeset viewer.