Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- >>> import smtplib
- >>> import time
- >>> absender = 'roof3@gmx.de'
- >>> adressat = 'manuelruf@gmx.de'
- >>> betreff = 'Teeest'
- >>> inhalt = 'Test1'
- >>> zeit = time.ctime(time.time())
- >>> text = 'From: '+absender+'\n'
- >>> text += 'To: '+adressat+'\n'
- >>> text += 'Date: '+zeit+'\n'
- >>> text += 'Subject: '+betreff+'\n'
- >>> text = text + inhalt
- >>> print text
- From: roof3@gmx.de
- To: manuelruf@gmx.de
- Date: Tue Oct 25 19:36:57 2011
- Subject: Teeest
- Test1
- >>> server = smtplib.SMTP('mail.gmx.net')
- Traceback (most recent call last):
- File "<pyshell#13>", line 1, in <module>
- server = smtplib.SMTP('mail.gmx.net')
- 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: (10060, 'Operation timed out')
Add Comment
Please, Sign In to add comment