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

相关推荐
Lsetea2 天前
Nginx报No required SSL certificate was sent:mTLS客户端证书排查
运维·nginx·https·ssl·openssl
其实防守也摸鱼4 天前
DeepSeek Harness 开源贡献手记:从入门到合入主线
服务器·数据库·windows·https·ssl
其实防守也摸鱼4 天前
堆叠注入(Stacked Injection)详解
服务器·数据库·windows·https·ssl
JamesShi1685 天前
华为云证书续费操作全流程,针对购买华为云企业门户建站的用户!
ssl
2601_967019515 天前
SSL 证书不止加密,还影响网站信任与 SEO
ssl
2601_967019516 天前
证书兼容性排查:SSL 部署后浏览器不安全告警分析
ssl
2601_967019517 天前
没有 SSL 证书的网站,会有哪些安全与流量损失?
ssl
一个心烑8 天前
配置项目git的 SSL 证书
git·网络协议·ssl
IT摆渡者10 天前
1panel 配置申请手动解析网站SSL证书
服务器·网络协议·ssl
IT摆渡者10 天前
1panel 针对HTTP自动续签SSL网站证书
网络协议·ssl·openresty