preexistant code : import sys, smtplib import string fromaddr = raw_input("From: ") toaddrs = string.splitfields(raw_input("To: "), ',') print "Enter message, end with ^D:" msg = '' count = 3 while count > 0: line = sys.stdin.readline() #if not line: # break msg = msg + line count = count -1 # The actual mail send server = smtplib.SMTP('localhost') server.sendmail(fromaddr, toaddrs, msg) server.quit()
----- Running the program: ------------------------------------------ From: prakash.st...@gmail.com To: prakash.st...@gmail.com hai how r u --------------------------- error creeps in : error says:::: Traceback (most recent call last): File "C:\Python25\python-collection\mail\mail.py", line 17, in <module> server = smtplib.SMTP('localhost') File "C:\Python25\lib\smtplib.py", line 244, in __init__ (code, msg) = self.connect(host, port) File "C:\Python25\lib\smtplib.py", line 310, in connect raise socket.error, msg error: (10061, 'Connection refused') On Mon, Mar 30, 2009 at 7:40 AM, prakash jp <prakash.st...@gmail.com> wrote: > Hi all, > > In windows environment, how to send email from one gmail address to another > gmail (or another mail) addrress > > > Regards > Prakash >
-- http://mail.python.org/mailman/listinfo/python-list