smtplib starttls gmail example

2007-01-23 Thread py
from smtplib import SMTP from socket import sslerror #if desired server = SMTP('smtp.gmail.com') server.set_debuglevel(0) # or 1 for verbosity server.ehlo('[EMAIL PROTECTED]') server.starttls() server.ehlo('[EMAIL PROTECTED]') # say hello again server.login('[EMAIL PROTECTED]', 'yourpasswo

Re: smtplib starttls gmail example

2007-01-23 Thread Jean-Paul Calderone
On Tue, 23 Jan 2007 17:25:24 GMT, py <[EMAIL PROTECTED]> wrote: >from smtplib import SMTP >from socket import sslerror #if desired >server = SMTP('smtp.gmail.com') >server.set_debuglevel(0) # or 1 for verbosity >server.ehlo('[EMAIL PROTECTED]') >server.starttls() >server.ehlo('[EMAIL PROTEC

Re: smtplib starttls gmail example

2007-01-23 Thread py
Hi, Jean Paul. I read your code with interest. I wonder, does twisted also raise the socket error or does it know about this apparently well-known and often ignored incompatibility between the standard and the implementations? Something else has occurred to me. After starting tls, all the xmitt

Re: smtplib starttls gmail example

2007-01-23 Thread py
Hmm, my last post seems to have been redirected to /dev/null. Anyhoo. Jean Paul, I read your code with interest. Does twisted also raise the apparently well-known and often ignored socket error, and do you supposed this error has something to do with the fact that the trailing \n.\n is encrypted?

Re: smtplib starttls gmail example

2007-01-23 Thread Jean-Paul Calderone
On Tue, 23 Jan 2007 23:48:59 GMT, py <[EMAIL PROTECTED]> wrote: >Hi, Jean Paul. > >I read your code with interest. I wonder, does twisted also raise the socket >error or does it know >about this apparently well-known and often ignored incompatibility between the >standard and >the implementations

RE: smtplib starttls gmail example - comments?

2007-01-23 Thread py
I would love for anybody to comment on this code with regard to redundancy/efficiency/wordiness or whatever else. for instance, do i understand correctly that i cant have a try: else: without an intervening except:? -dave stdout.write("calling smtp server...") try: se

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Tim Williams
On 24/01/07, py <[EMAIL PROTECTED]> wrote: > I would love for anybody to comment on this code with regard to > redundancy/efficiency/wordiness or whatever else. > for instance, do i understand correctly that i cant have a try: else: without > an intervening except:? > -dave > > stdout.wri

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread BJ Swope
On 1/24/07, Tim Williams <[EMAIL PROTECTED]> wrote: On 24/01/07, py <[EMAIL PROTECTED]> wrote: > I would love for anybody to comment on this code with regard to redundancy/efficiency/wordiness or whatever else. > for instance, do i understand correctly that i cant have a try: else: without an in

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Tim Williams
On 24/01/07, BJ Swope <[EMAIL PROTECTED]> wrote: > > > > On 1/24/07, Tim Williams <[EMAIL PROTECTED]> wrote: > > > > On 24/01/07, py <[EMAIL PROTECTED]> wrote: > > > I would love for anybody to comment on this code with regard to > redundancy/efficiency/wordiness or whatever else. > > > for instanc

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread BJ Swope
Sweet! -- http://mail.python.org/mailman/listinfo/python-list

Re: smtplib starttls gmail example - comments?

2007-01-24 Thread Gabriel Genellina
At Wednesday 24/1/2007 09:12, BJ Swope wrote: Both examples have included the cardinal sin in smtp... They both send the message text followed by new line dot new line. The smtp protocol specifically mentions CRLF dot CRLF. Please please please use \r\n.\r\n in your code... No. The SMTP o

Re: smtplib starttls gmail example - comments?

2007-01-25 Thread py
Excellent imput! I learned - no need for trailing . and i was doing it wrong anyway. - all those extra trys were redundant. - the trailing comma functionality in print. - the extra ehlo is an rfc req. Thanks all. -dave -- http://mail.python.org/mailman/listinfo/python-list