My Python gmail code (less password) for user feedback emails to myself, no mail software installed on my Linode. The details on ports etc. came from google's info on Gmail. This might be helpful as a model.
James
Code:
# email out
fromaddr = ""
if self.CONNECTION.args.has_key('ADDRESS'):
fromaddr = self.CONNECTION.args['ADDRESS']
if fromaddr == "":
fromaddr = "zunzun@zunzun.com"
toaddrs = ["zunzun@zunzun.com"]
# Add the From: and To: headers at the start!
msg = ("From: %s\r\nTo: %s\r\nSubject: ZunZun.com Feedback Form\r\n\r\n"
% (fromaddr, string.join(toaddrs, ", ")))
msg += "From " + fromaddr + "\n\n"
msg += dateAndTime + "\n\n"
msg += self.CONNECTION.args['FEEDBACK']
server = smtplib.SMTP('smtp.gmail.com', 587)
server.ehlo()
server.starttls()
server.ehlo()
server.login('zunzun@zunzun.com', 'PASSWORD_GOES_HERE')
server.sendmail(fromaddr, toaddrs, msg)
server.quit()