python create mail

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • anyab5@gmail.com

    #1

    python create mail

    hey I need help in sending email,

    It seems that while using this set of commands

    from smtplib import SMTP

    s = SMTP()
    s.set_debugleve l(1)
    s.connect('outm ail.huji.ac.il' )

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

    T:\Anya\work>ma il1.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\li b\smtplib.py", line 303, in connect
    raise socket.error, msg
    socket.error: (10053, 'Software caused connection abort')

    Does any one have a clue ?

  • Peter Hansen

    #2
    Re: python create mail

    anyab5@gmail.co m wrote:[color=blue]
    > hey I need help in sending email,
    >
    > It seems that while using this set of commands
    >
    > from smtplib import SMTP
    >
    > s = SMTP()
    > s.set_debugleve l(1)
    > s.connect('outm ail.huji.ac.il' )
    >
    > I should be able to get a connection but what I get is this error[/color]
    [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

    Comment

    • Tim Roberts

      #3
      Re: python create mail

      anyab5@gmail.co m wrote:
      [color=blue]
      >hey I need help in sending email,
      >
      >It seems that while using this set of commands
      >
      >from smtplib import SMTP
      >
      > s = SMTP()
      > s.set_debugleve l(1)
      > s.connect('outm ail.huji.ac.il' )
      >
      >I should be able to get a connection but what I get is this error
      >
      >T:\Anya\work>m ail1.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\li b\smtplib.py", line 303, in connect
      > raise socket.error, msg
      >socket.error : (10053, 'Software caused connection abort')
      >
      >Does any one have a clue ?[/color]


      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.[color=blue][color=green][color=darkred]
      >>> import smtplib
      >>> s = smtplib.SMTP()
      >>> s.set_debugleve l(1)
      >>> s.connect('outm ail.huji.ac.il' )[/color][/color][/color]
      connect: ('outmail.huji. ac.il', 25)
      connect: ('outmail.huji. ac.il', 25)
      reply: '220 mail3.cc.huji.a c.il ESMTP Postfix\r\n'
      reply: retcode (220); Msg: mail3.cc.huji.a c.il ESMTP Postfix
      connect: mail3.cc.huji.a c.il ESMTP Postfix
      (220, 'mail3.cc.huji. ac.il ESMTP Postfix')[color=blue][color=green][color=darkred]
      >>> ^Z[/color][/color][/color]

      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, timr@probo.com
      Providenza & Boekelheide, Inc.

      Comment

      Working...