Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Problem with exchange mail server
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Vinayakc, post: 1851113"] I am new for python. I have written one code which generates RFC2822 file. I have header in string format. i am using following code. emailData[SMTP_HEADER_POS] = emailData[SMTP_HEADER_POS].encode("utf-8") hdr = email.message_from_string(emailData[SMTP_HEADER_POS]) tmpContentType = msg['Content-Type'] del msg['Content-Type'] for key in hdr.keys(): values = hdr.get_all(key) if values != None: if key not in msg: for value in values: msg.add_header(key,value) if msg['Content-Type'] is None or msg['Content-Type'] == '': msg['Content-Type'] = tmpContentType is this right way to add the header?? This code is not doing well for exchange server mails. Python could not parse this mail header. Because first line is 'Microsoft exchange mail server version 2.0'. If I remove this line, it works. Could not understand this. Please help. Thanks and Regards Vinayakc [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Problem with exchange mail server
Top