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

相关推荐
零零发聊技术10 小时前
Python使用requests请求时ssl验证失败
python·ssl
2401_865854881 天前
ssl免费证书与收费证书有什么区别
网络·网络协议·ssl
奋斗者1号1 天前
SSL/TLS认证流程与CA证书字段详解
网络协议·iphone·ssl
ICT董老师2 天前
通过OpenSSL 生成自签名证书
linux·运维·服务器·https·ssl
詹某某34112 天前
什么是 IP SSL 证书?该如何申请
服务器·https·ssl
阿钱真强道2 天前
国密SM2的证书制作及验证
网络协议·https·ssl·安全架构
2501_948120153 天前
Java实现的SSL/TLS协议通信系统
java·开发语言·ssl
未来之窗软件服务3 天前
服务器运维(二十四) SSL数字证书管理续期—东方仙盟练气期
运维·服务器·ssl·仙盟创梦ide·东方仙盟
詹某某34114 天前
网站被提示“不安全”怎么解决
网络协议·https·ssl