• need help

    From Shuaib Akhtar@21:1/5 to All on Sun Oct 23 10:19:09 2022
    How to fix Traceback (most recent call last):

      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\socket.py",
    line 833, in create_connection

        sock.connect(sa)

    TimeoutError: [WinError 10060] A connection attempt failed because the
    connected party did not properly respond after a period of time, or
    established connection failed because connected host has failed to respond

     

    During handling of the above exception, another exception occurred:

     

    Traceback (most recent call last):

      File "C:\Users\i9shu\Downloads\python email bot\email bot.py", line 25,
    in <module>

        server = smtplib.SMTP('smtp.gmail.com',2525)

      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\smtplib.py",
    line 255, in __init__

        (code, msg) = self.connect(host, port)

      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\smtplib.py",
    line 341, in connect

        self.sock = self._get_socket(host, port, self.timeout)

      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\smtplib.py",
    line 312, in _get_socket

        return socket.create_connection((host, port), timeout,

      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\socket.py",
    line 833, in create_connection

        sock.connect(sa)

    KeyboardInterrupt

     

    Process finished with exit code -1073741510 (0xC000013A: interrupted by
    Ctrl+C)

    eorr

     

    Sent from [1]Mail for Windows

     

    References

    Visible links
    1. https://go.microsoft.com/fwlink/?LinkId=550986

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cameron Simpson@21:1/5 to Shuaib Akhtar on Mon Oct 24 10:02:10 2022
    Please try to choose more descriptive subject lines (eg "problem with sock.connect" or similar). That you want help is almost implicit, and
    what the whole list is for.

    Anyway, to your problem:

    On 23Oct2022 10:19, Shuaib Akhtar <i9shuaib1@gmail.com> wrote:
    How to fix Traceback (most recent call last):
      File "C:\Program
    Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0\lib\socket.py",
    line 833, in create_connection
        sock.connect(sa)
    TimeoutError: [WinError 10060] A connection attempt failed because
    the connected party did not properly respond after a period of time, or
    established connection failed because connected host has failed to respond

    This usually means that either the host address is legal but incorrect
    (there's no host/server listening with that address) or that the port is incorrect and some firewall is _discarding_ your traffic because of the
    wrong port instead of returning a nice "connection refused", which is
    usually instant.

    Fortunately you've listed your call:

      File "C:\Users\i9shu\Downloads\python email bot\email bot.py",
    line 25,
    in <module>
        server = smtplib.SMTP('smtp.gmail.com',2525)

    So, I'll try that by hand here:

    % telnet smtp.gmail.com 2525
    Trying 142.250.4.108...
    telnet: connect to address 142.250.4.108: Operation timed out
    Trying 2404:6800:4003:c0f::6d...
    telnet: connect to address 2404:6800:4003:c0f::6d: No route to host
    telnet: Unable to connect to remote host
    %

    I'd say GMail are rudely dropping traffic to port 2525. Maybe try just
    25, the normal SMTP port?

    Cheers,
    Cameron Simpson <cs@cskk.id.au>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From rbowman@21:1/5 to Cameron Simpson on Mon Oct 24 01:02:24 2022
    On Mon, 24 Oct 2022 10:02:10 +1100, Cameron Simpson wrote:


    I'd say GMail are rudely dropping traffic to port 2525. Maybe try just
    25,
    the normal SMTP port?

    2525 is an alternative to 587, the standard TLS port. 25 and 587 work.

    telnet smtp.gmail.com 587
    Trying 2607:f8b0:4023:1004::6d...
    Connected to smtp.gmail.com.
    Escape character is '^]'.
    220 smtp.gmail.com ESMTP s6-20020a056870ea8600b0010bf07976c9sm13154711oap.
    41 - gsmtp
    EHLO
    501-5.5.4 Empty HELO/EHLO argument not allowed, closing connection.
    501 5.5.4 https://support.google.com/mail/?p=helo s6-20020a056870ea8600b0010bf07976c9sm13154711oap.41 - gsmtp
    Connection closed by foreign host.


    The EHLO needs a domain. Port 25 is the same.

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Cameron Simpson@21:1/5 to rbowman on Mon Oct 24 15:01:12 2022
    On 24Oct2022 01:02, rbowman <bowman@montana.com> wrote:
    On Mon, 24 Oct 2022 10:02:10 +1100, Cameron Simpson wrote:
    I'd say GMail are rudely dropping traffic to port 2525. Maybe try
    just 25, the normal SMTP port?

    2525 is an alternative to 587, the standard TLS port.

    Yah. My point was more focussed on GMail's shoddy firewall practices not returning connection refused.

    25 and 587 work.

    Good to know. Thanks!
    Cameron Simpson <cs@cskk.id.au>

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Peter J. Holzer@21:1/5 to rbowman on Mon Oct 24 11:33:45 2022
    On 2022-10-24 01:02:24 +0000, rbowman wrote:
    On Mon, 24 Oct 2022 10:02:10 +1100, Cameron Simpson wrote:
    I'd say GMail are rudely dropping traffic to port 2525. Maybe try just
    25,
    the normal SMTP port?

    2525 is an alternative to 587, the standard TLS port.

    Port 587 is not the standard TLS port. Port 587 is the standard mail
    submission port (i.e., a MUA should use port 587 when sending mail; MTAs
    should use port 25 when relaying mails to other MTAs).

    Traffic on both port 25 and 587 starts in plain text. The server can
    indicate that it supports TLS and the client can then send a STARTTLS
    command to start a TLS session.

    If you want to start the connection with TLS, you can (usually) use port
    465. Like 587, this is only intended for mail submission, not mail
    transport.

    hp

    --
    _ | Peter J. Holzer | Story must make more sense than reality.
    |_|_) | |
    | | | hjp@hjp.at | -- Charles Stross, "Creative writing
    __/ | http://www.hjp.at/ | challenge!"

    -----BEGIN PGP SIGNATURE-----

    iQIzBAABCgAdFiEETtJbRjyPwVTYGJ5k8g5IURL+KF0FAmNWW/UACgkQ8g5IURL+ KF22bA//WY8MVX9bGSF9BdHc+pUWL+gRTg6IxAEAyQ0Uh7v1scK9HLwy3K2UnIk7 wjQCMioBTO5I/jKiewFza/cyEHCPmDzgUxUrUFeXgN6oKDUXPI0R/AUkTGac7izi eEyQtcqqpJZeL2hfZ6s7w0TAm2aMwK+UVsydEfbhuR8mHV6ondnFjg75r3ZuNTKG RQfFyn1CCH6SM3c+UwTnLbSx2+Z8Fu4XUXZneZB+wK4AOed5rLHUh9YqMdUyfGVu 7k4aj00tw0o/UoDb3/KDscwDlcPVWTKcWWOqhbumdr9O2VtFKRA6Wmn5NKr3VIMx WG30F9QA+DfLbqu2ZiPL864m8yJueiDLlSiOPaYb06Tp/OwdaY0tAYJYXJeUES3Z kvJIBC1m1titfJZj/RQ1aROdbI8Ms1IAsYWoOkEaHlAVnpxHICLhT9xOhxkLuacA F4kLT1C7MUFqhnYTqFpwcA2oPRk6LnXtK3fbLikK49LXhU/euJc2UOdfoQVvCEZU LjXDNu7G4BALzH1ED2rlizFJiBoQO11LxCq/eXYBKYE1K4T7PG9cQk3aMvH97+Dr QNlqpWVbUPD4lyZ2mfd4ODpRizyuI+DvzaLWaGrzvxU8Xphu3iVrXBiHWP72Xmaj uneYtrV1YafiLi46MAsEL/3bhD9bBLZdyfFDria