Re: [Email-SIG] FW: [Python-ideas] Standard library high level support for email messages

2013-02-04 Thread Daniel Reis
David,

   PS: what is pyzlib?  It sounds like a wrapper for zlib, which is what
   I get when I google for it.

Got it: it's one of the top results if you search for mail in PyPi:
http://pypi.python.org/pypi?%3Aaction=searchterm=mailsubmit=search


 Well, I'd prefer to avoid that at this stage, and leave those
 considerations for a later stage.  This is because that would lock us in
 to a particular, relatively complex API.  It would probably be better to
 leave that as a non-stdlib wrapper class for now, as we make the email
 library more and more complete so that such wrappers become simpler and
 simpler, until it becomes clear if/where to add it to the library.

This wrapper is really needed.
Or at the very least. the examples in the Python docs should provide a complete 
example on generating an e-mail with text/html alternate parts plus 
attachments. They don't.

I found a very good for-dummies reference and implementation here:
http://blog.magiksys.net/generate-and-send-mail-with-python-tutorial
(PS: just found out that it's author, Alain Spineux, is the author of pyzmail 
...)

As an example, buiding an email looks like this:

mail=gen_mail(
(my_utext.encode('iso-8859-1'), 'iso-8859-1'), 
(my_html, 'us-ascii'), 
 my_attachments, 
 my_related_parts_list)
 So, right now the most helpful thing would be reviewing bugs (tagged
 'email' in the tracker) and fixes.  Alternatively you could take a look
 at how I/we have done the header_factory in the new code, and think
 about what the corresponding message_factory would look like.  That will
 be the thing that will make managing attachments easier, and is what I
 plan to work on after finishing the list above.

Most of this is not very related to my current work and skill set. So 
unfortunately I'm afraid I wouldn't be much help. 
Maybe I could help improve the docs to add the more complete email usage 
example, but would most certainly be at the expense of Alain Spineux's work ...

Regards
Daniel Reis


  ___
Email-SIG mailing list
Email-SIG@python.org
Your options: 
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com

Re: [Email-SIG] FW: [Python-ideas] Standard library high level support for email messages

2013-01-31 Thread Daniel Reis
 PS: what is pyzlib?  It sounds like a wrapper for zlib, which is what
 I get when I google for it.

I'm sorry, I mispelled it: I ment pyzmail (http://pypi.python.org/pypi/pyzmail).
I do my best to stick to the standard library, so I didn't really use it 
(learned more about MIME instead).
For some reason it came to my attention, but I cant't track back why. Top 
result on PyPi for email actually is the email-sig  alpha module...

 In 3.2, smtplib already has a send_message method that will accept a
 Message object and send it.
 Once attaching things is easy, I think that plus send_message will get
 you 90+% of the way to where you would like to be.

`send_message` makes an important step forward: it's able to read the from 
and to from the msg headers.
Next step could be to assist in assembling the message.
The `message` object 's constructor could accept parameters to accelerate new 
message creation in a single call:  From, To, Cc, Bcc, Subject, and Body (HTML; 
 TEXT).
And then, as you said, make attaching things a little easier.

 I would welcome help working on this.  If you want to assist, this list
 is probably the best place to talk about it.

Of course. Feel free to suggest me any directions.
An idea is perhaps to discuss how using `message` objects should look like in 
some typical use cases, expanding what I said above in some code examples.

Regards
Daniel
  ___
Email-SIG mailing list
Email-SIG@python.org
Your options: 
http://mail.python.org/mailman/options/email-sig/archive%40mail-archive.com