Email Aol

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Jsnova864
    New Member
    • Apr 2007
    • 12

    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

    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"
    when i run it i get this error:
    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
    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
  • jlm699
    Contributor
    • Jul 2007
    • 314

    #2
    Typo = http//:www.aol.com

    Try http://www.aol.com

    Comment

    • Jsnova864
      New Member
      • Apr 2007
      • 12

      #3
      Thanks. i fixed it but i still get the same error.

      Comment

      • jlm699
        Contributor
        • Jul 2007
        • 314

        #4
        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.

        Comment

        • Jsnova864
          New Member
          • Apr 2007
          • 12

          #5
          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.c om" 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.

          Comment

          • Jsnova864
            New Member
            • Apr 2007
            • 12

            #6
            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.

            Code:
            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. ^_^

            Comment

            Working...