Commits

Jakub Wiśniowski committed 71e2b50

removed duplicated encoding which caused UnicodeDecodeError

Comments (0)

Files changed (1)

zine/utils/mail.py

         if not self.subject or not self.text or not self.to_addrs:
             raise RuntimeError("Not all mailing parameters filled in")
 
-        from_addr = self.from_addr.encode('utf-8')
-        to_addrs = [x.encode('utf-8') for x in self.to_addrs]
-
-
         msg = MIMEText(self.text.encode('utf-8'))
 
         #: MIMEText sucks, it does not override the values on
         del msg['Content-Transfer-Encoding']
         del msg['Content-Type']
 
-        msg['From'] = from_addr.encode('utf-8')
+        msg['From'] = self.from_addr.encode('utf-8')
         msg['To'] = ', '.join(x.encode('utf-8') for x in self.to_addrs)
         msg['Subject'] = self.subject.encode('utf-8')
         msg['Content-Transfer-Encoding'] = '8bit'