> The previous versions of web2py used to store the Content as > a List whereby the Text part and HTML part could be extracted > using: Content[0] and Content[1] formats. For some reasons, the new > update seems to store the Content as a String and not a List.
Since some releases back, the way of extracting html or text from email row contents is this (similar to attachments, with lists of dictionaries): # get the message >>> row = imap.inbox[i] # get the text from the first text part >>> text = row.content[0]["text"] "blah blah" # get the content type >>> text = row.content[0]["mime"] text/plain > Q: Can you implement an Email Parsing function to the DAL so that we > can retrieve multipart emails in a List or even Dict format? Done (see above) > What is the best way to retrieve Attachments too? Attachments are retrieved in a similar way but they have payload instead of text elements. -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

