Python 3:
# -*- coding: utf-8 -*-
from_name = input ( 'Name: ' )
from_name = from_name . encode ( 'utf8' )
from_name = str ( from_name )
msg [ 'From' ] = str ( from_name + ' <' + from_email + '>' )
Nekem most ez lenne a fontos: Óra <from@utf8.com>
Ehelyett (a fenti kóddal) ezt kapom: b'\xc3\x93ra' <from@utf8.com>