17 Nisan 2010 Cumartesi

python send smtp mail with smtplib

#!/usr/bin/python

import smtplib

server
= smtplib.SMTP('mail.gmx.com')
server.login(
'from@gmx.com','password')
message
= """From: From Person <from@gmx.com>
To: To Person <to@gmail.com>
Subject: SMTP e-mail test

This is a test e-mail message.
"""

server.sendmail(
'from@gmx.com',['to@hotmail.com','to@gmail.com'],message)
#{}
server.close()

Hiç yorum yok:

Yorum Gönder