![]() |
Sending email to 365 server - Printable Version +- Atozed Forums (https://www.atozed.com/forums) +-- Forum: Indy (https://www.atozed.com/forums/forum-8.html) +--- Forum: Indy General Discussion (https://www.atozed.com/forums/forum-9.html) +--- Thread: Sending email to 365 server (/thread-1633.html) |
Sending email to 365 server - zsleo - 04-22-2020 Here is an extract code I am using/testing that keeps returning the error: 'Socket Error # 10060'#$D#$A'Connection timed out.' Code: procedure TForm1.Button1Click(Sender: TObject); Can someone please help by pointing to what/where I going wrong TIA RE: Sending email to 365 server - rlebeau - 04-22-2020 (04-22-2020, 06:43 AM)zsleo Wrote: Here is an extract code I am using/testing that keeps returning the error: 'Socket Error # 10060'#$D#$A'Connection timed out.' The code looks fine to me. Did you verify with a packet sniffer, like Wireshark, that Indy is actually connecting to port 587, and is attempting to use TLS 1.2? Which version of the OpenSSL DLLs are you using? On which line of code does the error happen on? What does the call stack look like when the error happens? How long does it take to time out? TIdSSLIOHandlerSocketOpenSSL does use a 30 second timeout on Windows Vista+ if its ReadTimeout property is <= 0 (which it is by default). RE: Sending email to 365 server - zsleo - 04-22-2020 Did you verify with a packet sniffer, like Wireshark, that Indy is actually connecting to port 587, and is attempting to use TLS 1.2? [ZSL] I will with WireShark later today Which version of the OpenSSL DLLs are you using? [ZSL] openssl-1.0.2u-x64_86-win64 On which line of code does the error happen on? [ZSL] error at "idSMTP1.Connect;" What does the call stack look like when the error happens? [ZSL] Callstack: main thread ($30ac): 0068b8cb +073 Prj2.exe IdStack 929 +54 TIdStack.RaiseSocketError 0068b852 +016 Prj2.exe IdStack 852 +1 TIdStack.RaiseLastSocketError 0068b7bd +015 Prj2.exe IdStack 826 +2 TIdStack.CheckForSocketError 006879b4 +0b0 Prj2.exe IdStackWindows 2026 +20 TIdStackWindows.Connect 0069f351 +02d Prj2.exe IdSocketHandle 295 +1 TIdSocketHandle.Connect 006aa38d +1cd Prj2.exe IdIOHandlerStack 349 +52 TIdIOHandlerStack.ConnectClient 006eab2d +031 Prj2.exe IdSSLOpenSSL 2764 +8 TIdSSLIOHandlerSocketOpenSSL.ConnectClient 006ad9bb +063 Prj2.exe IdIOHandlerSocket 369 +13 TIdIOHandlerSocket.Open 006eac3f +007 Prj2.exe IdSSLOpenSSL 2800 +1 TIdSSLIOHandlerSocketOpenSSL.Open 006a963c +258 Prj2.exe IdTCPClient 327 +54 TIdTCPClientCustom.Connect 006b3ac4 +0a4 Prj2.exe IdExplicitTLSClientServerBase 257 +23 TIdExplicitTLSClient.Connect 006d116b +017 Prj2.exe IdSMTP 377 +2 TIdSMTP.Connect 006eecc1 +125 Prj2.exe Unit1 59 +21 TForm1.Button1Click 005af1ff +073 Prj2.exe Vcl.Controls 7536 +9 TControl.Click 005c6af6 +01e Prj2.exe Vcl.StdCtrls 5470 +3 TCustomButton.Click 005c760c +00c Prj2.exe Vcl.StdCtrls 5931 +1 TCustomButton.CNCommand 005aeca6 +2be Prj2.exe Vcl.Controls 7420 +91 TControl.WndProc 005b375b +63b Prj2.exe Vcl.Controls 10278 +166 TWinControl.WndProc 005c67a0 +06c Prj2.exe Vcl.StdCtrls 5307 +13 TButtonControl.WndProc 005ae8e0 +024 Prj2.exe Vcl.Controls 7198 +10 TControl.Perform 005b38bf +023 Prj2.exe Vcl.Controls 10347 +12 DoControlMsg 005b4343 +00b Prj2.exe Vcl.Controls 10622 +1 TWinControl.WMCommand 006580b9 +045 Prj2.exe Vcl.Forms 6488 +6 TCustomForm.WMCommand 005aeca6 +2be Prj2.exe Vcl.Controls 7420 +91 TControl.WndProc 005b375b +63b Prj2.exe Vcl.Controls 10278 +166 TWinControl.WndProc 00654d39 +64d Prj2.exe Vcl.Forms 4652 +209 TCustomForm.WndProc 005b2d28 +02c Prj2.exe Vcl.Controls 9977 +3 TWinControl.MainWndProc 004e9b08 +014 Prj2.exe System.Classes 17956 +8 StdWndProc 75e743fe +11e USER32.dll SendMessageW 75e744da +07a USER32.dll CallWindowProcW 005b386a +0e6 Prj2.exe Vcl.Controls 10319 +30 TWinControl.DefaultHandler 005af64c +010 Prj2.exe Vcl.Controls 7669 +1 TControl.WMLButtonUp 005aeca6 +2be Prj2.exe Vcl.Controls 7420 +91 TControl.WndProc 005b375b +63b Prj2.exe Vcl.Controls 10278 +166 TWinControl.WndProc 005c67a0 +06c Prj2.exe Vcl.StdCtrls 5307 +13 TButtonControl.WndProc 005b2d28 +02c Prj2.exe Vcl.Controls 9977 +3 TWinControl.MainWndProc 004e9b08 +014 Prj2.exe System.Classes 17956 +8 StdWndProc 75e73ebb +00b USER32.dll DispatchMessageW 0065e727 +0f3 Prj2.exe Vcl.Forms 10747 +23 TApplication.ProcessMessage 0065e76a +00a Prj2.exe Vcl.Forms 10777 +1 TApplication.HandleMessage 0065ea9d +0c9 Prj2.exe Vcl.Forms 10915 +26 TApplication.Run 006fb3fd +049 Prj2.exe Prj2 14 +4 initialization 75d36357 +017 KERNEL32.DLL BaseThreadInitThunk How long does it take to time out? TIdSSLIOHandlerSocketOpenSSL does use a 30 second timeout on Windows Vista+ if its ReadTimeout property is <= 0 (which it is by default). [ZSL] after about 30 seconds RE: Sending email to 365 server - rlebeau - 04-23-2020 (04-22-2020, 11:07 PM)zsleo Wrote: On which line of code does the error happen on? That trace means that Indy is attempting a direct TCP connection to the specified Host/Port, so a timeout on that operation at the OS layer means that either:
(04-22-2020, 11:07 PM)zsleo Wrote: How long does it take to time out? TIdSSLIOHandlerSocketOpenSSL does use a 30 second timeout on Windows Vista+ if its ReadTimeout property is <= 0 (which it is by default). The timeout in question that TIdSSLIOHandlerSocketOpenSSL uses internally only applies after the TCP connection has been established and the SSL/TLS handshake is in progress. You are not even getting that far, there is no TCP connection being established. RE: Sending email to 365 server - zsleo - 04-24-2020 Thank you for your help. Turns out the firewall for the network segment I am on had port 587 blocked... All is good now! |