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 - 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"
when i run it i get this error: - >>>
-
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
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
5 5016
Typo = http//:www.aol.com
Try http://www.aol.com
Thanks. i fixed it but i still get the same error.
Now I've never used the SMTP library but looking into the API the first line reads: "The smtplib module defines an SMTP client session object that can be used to send mail to any Internet machine with an SMTP or ESMTP listener daemon"( smtplib API).
www.aol.com does not qualify for this role.
You need to either have a local hostname mapped to specific machine or know the ip and port number of one that runs a (E)SMTP listener.
Sigh...Nothing like shooting for the moon with a slingshot xD . I did some research and you were right. Since I'm using stmplib I may want to try connecting to aol's smtp server. This website says that it has the url "smtp.aol.com" and uses the port "587". The site also says I need to do authentication with my aol username and password. Now I need to figure out how to write a python program to do this and probably implement an encryption program/module to hide my username and password.
Thanks for the help so far :D . I would have replied sooner but I forgot my password to the forum and couldn't log in xD sorry.
Woohoo. Figured it out a couple weeks ago. figured I would post it so people with a similar problem could look. As far as I know the way this program works is only with aol and if you have an account with aol. - import smtplib
-
-
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)
-
#if debug level is true then python prints what is sent to and sent from the email sever
-
mailServer.set_debuglevel(1)
-
#Username and password would be your aol useranme and password.
-
mailServer.login('UserName','Password')
-
mailServer.sendmail(sender, to, message)
-
mailServer.quit()
-
mail('smtp.aol.com:587','Username@aol.com','Whoever@Whatever.com','Fruitloop Jonhsen Wants a Hug','This was a test')
-
print "done"
thanks!! you guys helped piont me in the right direction. ^_^
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Chuck Anderson |
last post by:
Can anyone point me in the right direction? I want to use Php to
automate confirmation of someone joining an email list by them replying
to an email (so they don't have to have a browser?).
I...
|
by: dmiller23462 |
last post by:
So here's my problem.....I need to set up different email
distributions based on which option in the following Select form has
been chosen....For instance if "Putaway" is chosen it needs to email...
|
by: Mike |
last post by:
Is there a way to determine what a user's default email client is? I
read a post from 3 years ago that said no. I guess I'm hoping
something has come along since then.
|
by: BSG-SMTP-Gateway |
last post by:
The following message sent by this account has violated system policy:
Connection From: 64.253.55.90
From: python-list@python.org
To: terriss@birdsall.com, q4dzsAEAAAAA@birdsall.com,...
|
by: libsfan01 |
last post by:
Hi all!
Can anyone show me how to check and email field on a form for the
existence of these two characters.
Kind regards
Marc
|
by: g0c |
last post by:
hi,
how to hide or replace email addresses in php mail function
with something like "group" so the email addresses to which email
is sent are not visible ?
i have :
$subs = "email1@dot.com,...
|
by: Erik Johnson |
last post by:
THE GOAL: I need to send an email with a simple ASCII text body and an
attached HTML file.
I have scripts that send basic emails via the smtplib module that don't
have any attachements and that...
|
by: Craig Hurley |
last post by:
Hello,
user@x.com receives an email from user@a.com. I want to forward that
email to user@y.com. I want the contents/header to remain intact, with
the exception of adding "X-Forwarded-For". ...
|
by: IGD |
last post by:
I don't know if this is the right place to post this or not. If not,
could someone direct me elsewhere where I would find more information
on how to solve my problem? Thanks!
My problem is this:...
|
by: matheussousuke |
last post by:
I'm having trouble with e-mail sending, I mean, the website is suposed to send a confirmation email after sign up, but it gets like text plain instead of HTML
May someone help me, please?
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |