def set_mimetext_headers(self, message, subject, from_addr, to_addrs, cc_addrs, priority):
        """Sets headers on Mimetext message"""

        message['Subject'] = subject
        message['From'] = from_addr
        message['To'] = ', '.join(to_addrs)
        if cc_addrs:
            message['Cc'] = ', '.join(cc_addrs)

        if priority and self.priority_header_is_valid(priority):
            priority = PRIORITIES[str(priority)].copy()
            for key in priority:
                message[key] = priority[key]

        return message
Sets headers on Mimetext message