且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

无法通过Delphi 2010和Indy 10.5.5使用安全SMTP连接到Office365

更新时间:2023-02-07 22:33:29

显然,自从Remy在链接的问题中写下答案以来,Office365已停止支持SSLv3(大概是为了避免已知漏洞),现在需要TLS。如果您更改以下两行,则他在原始问题中的答案中的代码将起作用:

Apparently, since Remy wrote the answer in the linked question, Office365 has stopped supporting SSLv3 (presumably to avoid a known exploit) and now requires TLS. The code from his answer in the original question works if you change these two lines:

idSMTP1.UseTLS := utUseImplicitTLS;
TIdSSLIOHandlerSocketOpenSSL(idSMTP1.IOHandler).SSLOptions.Method := sslvSSLv3;

至:

idSMTP1.UseTLS := utUseExplicitTLS;
TIdSSLIOHandlerSocketOpenSSL(idSMTP1.IOHandler).SSLOptions.Method := sslvTLSv1;