| | |
Emailing unicode chars?
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jul 2009
Posts: 31
Reputation:
Solved Threads: 2
The following fails with an error message about not being able to encode the euro char. It works fine without the €.
I have the feeling I'm missing something simple here, but can't figure it out. A fix would be appreciated.
I'd like to use this in 2.5.4 and 3.1
I have the feeling I'm missing something simple here, but can't figure it out. A fix would be appreciated.
I'd like to use this in 2.5.4 and 3.1
Python Syntax (Toggle Plain Text)
import smtplib from email.mime.text import MIMEText sender = to = 'ABC@DEF.com' server = 'smtp.DEF.com' msg = MIMEText('€10') msg['Subject'] = 'Hello' msg['From'] = sender msg['To'] = to s = smtplib.SMTP(server) s.sendmail(sender, [to], msg.as_string()) s.quit()
•
•
Join Date: Jun 2009
Posts: 2
Reputation:
Solved Threads: 0
See if Unicode Emails in Python does anything to solve the problem.
It looks to me like you are reuqired to set the mime encoding to tell it you are using Unicode
It looks to me like you are reuqired to set the mime encoding to tell it you are using Unicode
![]() |
Similar Threads
- What sql data type to use (Database Design)
- Escape and Unescape / Handling (C)
- Character's Unicode Value (Java)
- Handle unicode characters (Python)
- lowercase chars (C)
- Homepage has been changed to about:blank (Viruses, Spyware and other Nasties)
- Working with SQL's Text data type (ASP.NET)
- Encoding (Unicode) problem in IE 6.0 (Web Browsers)
Other Threads in the Python Forum
- Previous Thread: Problems with sorting in python 3
- Next Thread: write program to extract data
| Thread Tools | Search this Thread |
Tag cloud for Python
ansi assignment avogadro backend beginner binary bluetooth character cmd code copy customdialog data decimals dictionary drive dynamic error examples excel exe file float format ftp function gnu graphics gui heads homework http ideas import input java leftmouse line linux list lists logging loop module mouse newb number numbers output parsing path pointer port prime program programming progressbar projects push py2exe pygame pyglet pyqt python random recursion recursive refresh schedule scrolledtext sqlite ssh statistics stdout string strings sudokusolver sum table terminal text thread threading time tkinter tlapse tricks tuple tutorial ubuntu unicode update urllib urllib2 variable wikipedia windows write wxpython xlib





