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

相关推荐
Navicat中国1 天前
使用 SSL/TLS 安全连接数据库
数据库·安全·ssl
成空的梦想2 天前
免费 vs 付费国密 SSL 怎么选?
服务器·网络·网络协议·http·https·ssl
江上清风山间明月4 天前
RPC failed; curl 65 OpenSSL SSL_read: OpenSSL/3.1.2错误解决方法
网络协议·rpc·ssl·failed
Edward111111116 天前
SSL/TSL配置 集群节点间通信加密还有客户端
linux·服务器·ssl
七七powerful6 天前
AI+运维提效--SSL 证书监控系统v3.0版本开发完成
网络·网络协议·ssl
HelloWorld工程师7 天前
SSL证书在哪里可以免费且快速申请?
服务器·网络协议·ssl
昆曲之源_娄江河畔8 天前
DBGridEh Footer的使用
前端·数据库·delphi·dbgrideh
落叶_Jim10 天前
Let‘s Encrypt证书有效期缩短至90天后,如何实现自动续期
网络协议·https·ssl
七七powerful10 天前
AI+运维提效,ssl-cert-monitoring(SSL证书监控系统)2.0开发完毕
运维·网络协议·ssl
七七powerful10 天前
AI+运维提效,ssl-cert-monitoring(SSL证书监控系统)2.0修复bug及新增功能说明
运维·服务器·ssl