> *Can you please post the code used to Attach Files?* > *And also the code used to Save-as-Draft to IMAP servers and/or Send via > SMTP.* > > The code from IVINH's app (posted at the google code issue 1707 page) is more complicated. After recent changes to dal.py in trunk you should be able to post messages as drafts by just using the recipe at web2pyslices. For non plain-text files (i.e. excel xls), you first need to encode the payload using the base64 stdlib module
>>> encoded_payload = base64.b64encode(<file output>) and also specify "base64" for the attachment encoding. You can also add info on the mime type with the attachment mime key. Note: for random attachment file types you application should also detect what type of file is being uploaded and then change the attachment attributes accordingly. -- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.