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

相关推荐
赤月奇2 天前
https改为http
数据挖掘·https·ssl
k7Cx7e3 天前
宝塔域名强制SSL和带www的方法
网络·网络协议·ssl
qq_316837753 天前
使用 certbot docker镜像生成阿里云域名ssl证书
阿里云·docker·ssl
文静小土豆3 天前
CentOS 7 升级 OpenSSL 3.5.4 详细指南
linux·运维·centos·ssl
biubiubiu07063 天前
Certbot 申请SSL证书的三种方式详解(Ubuntu 22.04环境)
网络·网络协议·ssl
pcplayer3 天前
Delphi程序和大模型交互之二
人工智能·ai·大模型·agent·delphi
宇宙核4 天前
FreeSSL实现域名证书免费无限自动续签续期流程
linux·服务器·ssl·持续部署
风早爽太4 天前
使用 CocoaPods 出现 SSL 证书验证失败错误的临时解决方案
ssl·cocoapods
qq_316837756 天前
caddy 使用阿里云的域名通过dns验证申请ssl证书
阿里云·云计算·ssl
无籽西瓜a8 天前
SSL/TLS工作流程以及HTTP与HTTPS详解
http·https·ssl