473,397 Members | 2,099 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Email Aol

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

Expand|Select|Wrap|Line Numbers
  1. def mail(serverURL=None, sender='', to='', subject='', text=''):
  2.     """
  3.     Usage:
  4.     mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test')
  5.     """
  6.     headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject)
  7.     message = headers + text
  8.     mailServer = smtplib.SMTP(serverURL)
  9.     mailServer.sendmail(sender, to, message)
  10.     mailServer.quit()
  11.  
  12. mail('http//:www.aol.com','Jsnova864@aol.com','Jsnova864@aol.com','test','this is a test')
  13. print "done"
when i run it i get this error:
Expand|Select|Wrap|Line Numbers
  1. >>> 
  2. Traceback (most recent call last):
  3.   File "C:\Documents and Settings\Josh Seeley\My Documents\email test.py", line 14, in <module>
  4.     mail('http//:www.aol.com','Jsnova864@aol.com','Jsnova864@aol.com','test','this is a test')
  5.   File "C:\Documents and Settings\Josh Seeley\My Documents\email test.py", line 10, in mail
  6.     mailServer = smtplib.SMTP(serverURL)
  7.   File "C:\Program Files\Programmming\Python_2.5\lib\smtplib.py", line 244, in __init__
  8.     (code, msg) = self.connect(host, port)
  9.   File "C:\Program Files\Programmming\Python_2.5\lib\smtplib.py", line 291, in connect
  10.     raise socket.error, "nonnumeric port"
  11. 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
Apr 18 '08 #1
5 5016
jlm699
314 100+
Typo = http//:www.aol.com

Try http://www.aol.com
Apr 18 '08 #2
Thanks. i fixed it but i still get the same error.
Apr 19 '08 #3
jlm699
314 100+
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.
Apr 21 '08 #4
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.
Apr 22 '08 #5
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.

Expand|Select|Wrap|Line Numbers
  1. import smtplib
  2.  
  3. def mail(serverURL=None, sender='', to='', subject='', text=''):
  4.     """
  5.     Usage:
  6.     mail('somemailserver.com', 'me@example.com', 'someone@example.com', 'test', 'This is a test')
  7.     """
  8.     headers = "From: %s\r\nTo: %s\r\nSubject: %s\r\n\r\n" % (sender, to, subject)
  9.     message = headers + text
  10.     mailServer = smtplib.SMTP(serverURL)
  11.     #if debug level is true then python prints what is sent to and sent from the email sever
  12.     mailServer.set_debuglevel(1)
  13.     #Username and password would be your aol useranme and password.
  14.     mailServer.login('UserName','Password')
  15.     mailServer.sendmail(sender, to, message)
  16.     mailServer.quit()
  17. mail('smtp.aol.com:587','Username@aol.com','Whoever@Whatever.com','Fruitloop Jonhsen Wants a Hug','This was a test')
  18. print "done"

thanks!! you guys helped piont me in the right direction. ^_^
May 3 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

12
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...
4
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...
88
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.
2
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,...
26
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
3
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,...
3
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...
15
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". ...
3
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:...
27
matheussousuke
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? ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
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...
0
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...
0
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...
0
jinu1996
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...
0
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...
0
agi2029
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,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.