I want to write a program similiar to kgb spy for my flash drive. So when I lose it, it will email me with keylogger event and give me an idea of where it is or who took it.
I dont know anything about emialing so i dont know how to write a pogram that does it xD.
I picked this up from somewhere. apologizer for not remebering where i got it.
import smtplib
when i run it i get this error:
no idea what a nonnumeric port is and the results i got searching weren't exactly in english...
Thanks to anyone with the patience to help me :D
p.s window xp, python 2.5
I dont know anything about emialing so i dont know how to write a pogram that does it xD.
I picked this up from somewhere. apologizer for not remebering where i got it.
import smtplib
Code:
def mail(serverURL=None, sender='', to='', subject='', text=''):
"""
Usage:
mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test')
"""
headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject)
message = headers + text
mailServer = smtplib.SMTP(serverURL)
mailServer.sendmail(sender, to, message)
mailServer.quit()
mail('http//:www.aol.com','Jsnova864@aol.com','Jsnova864@aol.com','test','this is a test')
print "done"
Code:
>>>
Traceback (most recent call last):
File "C:\Documents and Settings\Josh Seeley\My Documents\email test.py", line 14, in <module>
mail('http//:www.aol.com','Jsnova864@aol.com','Jsnova864@aol.com','test','this is a test')
File "C:\Documents and Settings\Josh Seeley\My Documents\email test.py", line 10, in mail
mailServer = smtplib.SMTP(serverURL)
File "C:\Program Files\Programmming\Python_2.5\lib\smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "C:\Program Files\Programmming\Python_2.5\lib\smtplib.py", line 291, in connect
raise socket.error, "nonnumeric port"
error: nonnumeric port
Thanks to anyone with the patience to help me :D
p.s window xp, python 2.5
Comment