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

相关推荐
全栈工程师修炼指南13 小时前
Nginx | stream 四层反向代理:SSL、PREREAD 阶段模块指令浅析与实践
运维·网络·网络协议·nginx·ssl
yixvxi1 天前
RFC 8659:DNS CAA资源记录
服务器·https·ssl
only_Klein2 天前
jenkins流水线报错:Connection reset by peer
ci/cd·kubernetes·gitlab·jenkins·ssl
JoySSLLian2 天前
OV SSL 证书:权威身份验证,让网络交互更可信
开发语言·网络·人工智能·网络协议·tcp/ip·php·ssl
深圳市恒讯科技3 天前
2026新加坡服务器配置全攻略:SSL证书、硬件防火墙与CDN加速
运维·服务器·ssl
JoySSLLian3 天前
IP SSL证书是什么?为何它是保障IP通信安全的关键?
网络协议·tcp/ip·https·ssl
Arvin6273 天前
研发环境:SSL证书快速部署
网络·网络协议·ssl
前进的程序员3 天前
OpenSSL加解密原理及使用方法详解
ssl·加解密·openssl
星夜落月4 天前
Certimate证书自动化管理:从零开始的私有化部署指南
运维·自动化·ssl
Genie cloud6 天前
1Panel SSL证书申请完整教程
服务器·网络协议·云计算·ssl