Re: [Tutor] How to send an email using Python

2009-03-11 Thread Samuel Avinash
Hey Stefan,Thanks for your response.My script is similar to yours, but as you've pointed that it could be temporary. I've been retrying to connect and send email but in vain. Here's the snippet of my code. Can you debug and help me what could really have gone wrong. import smtplib import base6

Re: [Tutor] How to send an email using Python

2009-03-11 Thread Samuel Avinash
Hey Senthil,Thanks for your response. My script is similar to yours, but as you've pointed that it could be temporary. I've been retrying to connect and send email but in vain.Here's the snippet of my code. Can you debug and help me what could really have gone wrong.import smtplibimport base64s

Re: [Tutor] How to send an email using Python

2009-03-10 Thread Stefan Lesicnik
Hi. I use the following to send through gmail. message = headers + text mailserver = smtplib.SMTP('smtp.gmail.com') if debug == 1: mailserver.set_debuglevel(1) mailserver.ehlo() mailserver.starttls() mailserver.ehlo() #Define username / password

Re: [Tutor] How to send an email using Python

2009-03-10 Thread Senthil Kumaran
Hello Samuel, When sending through smtp.gmail.com you might need to starttls() and do a login() before sending. >>> import smtplib >>> headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" %(from,to,subject) >>> message = headers + "Hello, How are you?" >>> mailserver = smtplib.SMTP('smtp.gmail.c