Finally I have the working version,It looks like this
#############
from email.Message import Message
from email.MIMEText import MIMEText
from email.Header import Header
import smtplib
msg = Message()
Body='Rídících Márinka a Školák Kája
Marík'.decode('utf8').encode('windows-1250')# I use the text written
in my editor with utf-8 coding, so first I decode and then encode to
windows-1250
msg = MIMEText(Body,'plain', 'windows-1250')#add body to email and with
 proper coding
h = Header('Ceské knihy - made by Czech
Republic'.decode('utf8').encode('windows-1250'), 'windows-1250')#Also
subject should be a proper coding with
msg['Subject'] = h# add the header to the message
s = smtplib.SMTP() # and send
s.connect()
s.sendmail('[EMAIL PROTECTED]', '[EMAIL PROTECTED]', msg.as_string())
s.close()
#############
Hope it may be useful to others

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to