Advertisement
Guest User

Untitled

a guest
Sep 22nd, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.01 KB | None | 0 0
  1. ****************script*****************
  2. #!/usr/bin/python
  3.  
  4. import smtplib
  5. fromaddr = 'blah@yahoo.com'
  6. toaddrs = 'blah@gmail.com'
  7. subject = "New call in!"
  8. msg = 'New call in!!!'
  9.  
  10. username = 'blah@gmail.com'
  11. password = 'bite-me'
  12.  
  13. server = smtplib.SMTP('smtp.gmail.com:587')
  14. server.starttls()
  15. server.login(username,password)
  16. server.sendmail(fromaddr, toaddrs,subject, msg)
  17. server.quit()
  18.  
  19. **************************errors**************
  20.  
  21.  
  22. python /home/prog-shit/sendmail-script.py
  23. Traceback (most recent call last):
  24. File "/home/prog-shit/sendmail-script.py", line 15, in <module>
  25. server.sendmail(fromaddr, toaddrs,subject, msg)
  26. File "/usr/lib/python3.1/smtplib.py", line 718, in sendmail
  27. (code,resp) = self.data(msg)
  28. File "/usr/lib/python3.1/smtplib.py", line 485, in data
  29. (code,msg)=self.getreply()
  30. File "/usr/lib/python3.1/smtplib.py", line 345, in getreply
  31. raise SMTPServerDisconnected("Connection unexpectedly closed")
  32. smtplib.SMTPServerDisconnected: Connection unexpectedly closed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement