Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ****************script*****************
- #!/usr/bin/python
- import smtplib
- fromaddr = 'blah@yahoo.com'
- toaddrs = 'blah@gmail.com'
- subject = "New call in!"
- msg = 'New call in!!!'
- username = 'blah@gmail.com'
- password = 'bite-me'
- server = smtplib.SMTP('smtp.gmail.com:587')
- server.starttls()
- server.login(username,password)
- server.sendmail(fromaddr, toaddrs,subject, msg)
- server.quit()
- **************************errors**************
- python /home/prog-shit/sendmail-script.py
- Traceback (most recent call last):
- File "/home/prog-shit/sendmail-script.py", line 15, in <module>
- server.sendmail(fromaddr, toaddrs,subject, msg)
- File "/usr/lib/python3.1/smtplib.py", line 718, in sendmail
- (code,resp) = self.data(msg)
- File "/usr/lib/python3.1/smtplib.py", line 485, in data
- (code,msg)=self.getreply()
- File "/usr/lib/python3.1/smtplib.py", line 345, in getreply
- raise SMTPServerDisconnected("Connection unexpectedly closed")
- smtplib.SMTPServerDisconnected: Connection unexpectedly closed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement