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

相关推荐
阿凤211 天前
nginx部署如何配置ssl证书
运维·nginx·ssl
AscendKing2 天前
一款开源、本地部署的 SSL 证书自动化管理工具Certimate介绍 部署教程
开源·自动化·ssl
MonkeyKing_sunyuhua2 天前
Nginx + Let’s Encrypt 免费 SSL 证书 的完整配置过程
运维·nginx·ssl
专注VB编程开发20年2 天前
delphi死嗑Pascal冷门编程语言,Borland不认可 “通用多语言 IDE”,认为 “专有语言才是护城河”
开发语言·ide·delphi
专注VB编程开发20年2 天前
Delphi 的VCL控件库无法公开给其他编程语言调用
开发语言·delphi
wAEWQ6Ib73 天前
当今互联网安全的基石 - TLS/SSL
网络·安全·ssl
芯智工坊4 天前
第8章 Mosquitto消息高级特性
网络·人工智能·mqtt·开源·ssl
芯智工坊4 天前
第7章 Mosquitto增加SSL/TLS加密通信
网络协议·https·ssl
EmbeddedCore4 天前
低成本物联网产品放弃SSL加密的隐形成本与市场逻辑
物联网·网络协议·ssl
EmbeddedCore4 天前
守护网络通信的基石:深入解析SSL/TLS协议
网络·网络协议·ssl