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

相关推荐
pcplayer15 小时前
非常好用的 Excel 读写控件
excel·delphi·office
willhuo2 天前
Certbot工具在CentOS 7.9上申请和配置SSL证书完整教程
linux·centos·ssl
不羁的fang少年2 天前
https机制
服务器·https·ssl
YanDDDeat2 天前
【计算机网络】SSL/TLS加密
网络协议·计算机网络·ssl
独隅3 天前
SSL协议深度解析:从历史演进到现代安全实践
网络协议·安全·ssl
0709003 天前
免费ssl证书自动申请续期部署(90天)
ssl
草根站起来4 天前
GeoTrust G2 TLS CN RSA4096 SHA256 2022 CA1
ssl
困惑阿三6 天前
Nginx 域名绑定与 HTTPS 配置指南
运维·nginx·https·ssl
lars_lhuan6 天前
K8s跨命名空间SSL认证解决方案:Reflector工具实战
容器·kubernetes·ssl
PinTrust SSL证书7 天前
Sectigo(Comodo)域名型DV通配符SSL
网络·网络协议·http·网络安全·https·软件工程·ssl