delphi发送SSL 465端口邮件

Delphi 复制代码
var
 maxLinkid,hezhun,emialcom:string;
 Snno:integer;
begin


   IdMessage1.CharSet:='UTF-8' ;
   IdMessage1.ContentType := 'text/html';
   IdMessage1.Body.Clear;

   IdMessage1.From.address:=efrom.Text;

   IdMessage1.Body.Add(ebody.Text);

       IdMessage1.Recipients.EMailAddresses:=eto.text;
       IdMessage1.Subject:='IT test System';
       IdMessage1.CCList.EMailAddresses:=ecc.Text;

    try
    Screen.Cursor:=crHourGlass;

    IdSSLIOHandlerSocket1.SSLOptions.VerifyMode := [sslvTLSv32];//与服务器验证类型一致

    idsmtp1.AuthType:=satDefault;

    IdSMTP1.HeloName:='163.com';   //服务器域名
    idsmtp1.UseTLS := utUseImplicitTLS;   //支持邮件发送SS
    idsmtp1.Username:=euserid.Text;//账号 
    idsmtp1.Password:=epass.Text;//密码;
    idsmtp1.Host:=eip.Text;//'';
    idsmtp1.Port:=strtoint(eport.Text);//端口;
    idsmtp1.Connect();
    idsmtp1.Authenticate;
    idsmtp1.Send(IdMessage1);
    idsmtp1.Disconnect;

      showmessage('成功..');
      Screen.Cursor:=crDefault;
   except  on ee:exception do
   begin
      Screen.Cursor:=crDefault;
      idsmtp1.Disconnect;
      messagedlg(ee.Message,mtError,[mbOK],0);

   end;
   end;

用例下载地址:

https://download.csdn.net/download/dgthm/92589626?spm=1001.2014.3001.5503

相关推荐
程序员mine14 天前
HTTPS-TLS加密与证书完全指南(中)
网络协议·https·ssl
开发者联盟league14 天前
pnpm install报错ERR_SSL_PACKET_LENGTH_TOO_LONG问题解决
网络·网络协议·ssl
北极熊~~14 天前
win上编译带ssl的paho-cpp库
mqtt·ssl·源码编译mqtt库
GlobalSign数字证书15 天前
SSL证书过期致业务宕机?企业证书管理三大痛点与自动化方案
网络协议·自动化·ssl
GlobalSign数字证书15 天前
Nginx配置SSL证书教程:从零到HTTPS的完整部署指南
nginx·https·ssl
疯狂的维修15 天前
博图不同版本下的OPC UA功能开启区别
服务器·https·ssl
master33615 天前
SSL 证书链问题导致微信小程序无法正常工作
网络协议·微信小程序·ssl
极创信息16 天前
信创产品适配测试认证,域名和SSL是必须的吗?
java·开发语言·网络·python·网络协议·ruby·ssl
吠品20 天前
一次 Nginx 报错 unexpected end of file 的排查记录
网络协议·https·ssl
Orchestrator_me20 天前
Python pip install报SSL错误
python·ssl·pip