python create mail

Discussion in 'Python' started by anyab5@gmail.com, Jan 12, 2006.

  1. Guest

    hey I need help in sending email,

    It seems that while using this set of commands

    from smtplib import SMTP

    s = SMTP()
    s.set_debuglevel(1)
    s.connect('outmail.huji.ac.il')

    I should be able to get a connection but what I get is this error

    T:\Anya\work>mail1.py
    connect: ('outmail.huji.ac.il', 25)
    connect: ('outmail.huji.ac.il', 25)
    connect fail: ('outmail.huji.ac.il', 25)
    Traceback (most recent call last):
    File "C:\Python24\lib\smtplib.py", line 303, in connect
    raise socket.error, msg
    socket.error: (10053, 'Software caused connection abort')

    Does any one have a clue ?
     
    , Jan 12, 2006
    #1
    1. Advertising

  2. Peter Hansen Guest

    wrote:
    > hey I need help in sending email,
    >
    > It seems that while using this set of commands
    >
    > from smtplib import SMTP
    >
    > s = SMTP()
    > s.set_debuglevel(1)
    > s.connect('outmail.huji.ac.il')
    >
    > I should be able to get a connection but what I get is this error

    [snip]

    Try connecting with telnet from the command line.

    telnet outmail.huji.ac.il 25

    You should see some sort of greeting from the server, probably starting
    with "220".

    If that works, then the Python code should work. If that does not work,
    then it's not a Python problem (firewall, host rejecting your address,
    no SMTP server on that host, etc).

    -Peter
     
    Peter Hansen, Jan 12, 2006
    #2
    1. Advertising

  3. Tim Roberts Guest

    wrote:

    >hey I need help in sending email,
    >
    >It seems that while using this set of commands
    >
    >from smtplib import SMTP
    >
    > s = SMTP()
    > s.set_debuglevel(1)
    > s.connect('outmail.huji.ac.il')
    >
    >I should be able to get a connection but what I get is this error
    >
    >T:\Anya\work>mail1.py
    >connect: ('outmail.huji.ac.il', 25)
    >connect: ('outmail.huji.ac.il', 25)
    >connect fail: ('outmail.huji.ac.il', 25)
    >Traceback (most recent call last):
    > File "C:\Python24\lib\smtplib.py", line 303, in connect
    > raise socket.error, msg
    >socket.error: (10053, 'Software caused connection abort')
    >
    >Does any one have a clue ?



    C:\Dev>python
    Python 2.4.1 (#65, Mar 30 2005, 09:13:57) [MSC v.1310 32 bit (Intel)] on
    win32
    Type "help", "copyright", "credits" or "license" for more information.
    >>> import smtplib
    >>> s = smtplib.SMTP()
    >>> s.set_debuglevel(1)
    >>> s.connect('outmail.huji.ac.il')

    connect: ('outmail.huji.ac.il', 25)
    connect: ('outmail.huji.ac.il', 25)
    reply: '220 mail3.cc.huji.ac.il ESMTP Postfix\r\n'
    reply: retcode (220); Msg: mail3.cc.huji.ac.il ESMTP Postfix
    connect: mail3.cc.huji.ac.il ESMTP Postfix
    (220, 'mail3.cc.huji.ac.il ESMTP Postfix')
    >>> ^Z


    C:\Dev>

    It's possible they simply had a temporary outage, assuming that you aren't
    sending this from some known spammer IP address.
    --
    - Tim Roberts,
    Providenza & Boekelheide, Inc.
     
    Tim Roberts, Jan 14, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Curt_C [MVP]
    Replies:
    5
    Views:
    372
    Karim
    May 19, 2004
  2. Barry Warsaw
    Replies:
    0
    Views:
    289
    Barry Warsaw
    Dec 18, 2003
  3. Replies:
    0
    Views:
    1,009
  4. Replies:
    0
    Views:
    426
  5. Replies:
    0
    Views:
    506
Loading...

Share This Page