Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

printing - How can I extract only the email body with Python using IMAP? -


i relatively new programming , python, think have done ok far. code have, , works fine, except gets entire message in mime format. want text body of unread emails, can't quite figure out how strip out of formatting , header info. if send basic email using smtp python script made works fine, , prints body, if send email using outlook prints bunch of garbage. appreciated.

client = imaplib.imap4_ssl(popserver)  client.login(user, password) client.select('inbox') status, email_ids = client.search(none, '(unseen subject "%s")' % printsubject) print email_ids client.store(email_ids[0].replace(' ',','),'+flags','\seen') email in get_emails(email_ids): 

get_emails()

    def get_emails(email_ids):         data = []         e_id in email_ids[0].split():             _, response = client.fetch(e_id, '(uid body[text])')             data.append(response[0][1])         return data 

sounds you're looking email package:

email package provides standard parser understands email document structures, including mime documents. can pass parser string or file object, , parser return root message instance of object structure. simple, non-mime messages payload of root object string containing text of message. mime messages, root object return true is_multipart() method, , subparts can accessed via get_payload() , walk() methods.

Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -