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

相关推荐
MyFreeIT8 小时前
Let‘s Encrypt SSL 製作免費證書
网络协议·https·ssl
00后程序员张11 小时前
Android证书绑定抓包失败?Android SSL Pinning绕过实战指南
android·网络协议·计算机网络·网络安全·adb·https·ssl
武帝为此14 小时前
【TLS SSL 介绍】
网络·网络协议·ssl
吠品4 天前
SQL Server 版本查询的几种实用方法
数据库·网络协议·ssl
瓦格哈儿4 天前
内网环境也需要证书?聊聊内网 IP 证书的适用边界
网络协议·ssl
CZIDC5 天前
华为服务器TS200-2280 V2 iBMC导入SSL证书后问题案例分析
服务器·https·ssl
m0_617493947 天前
SSLError [ASN1: NOT_ENOUGH_DATA] 问题排查与解决指南
python·ssl
左钦杨9 天前
如何剩下一笔SSL(https)证书的钱?
网络协议·https·ssl
就叫飞六吧11 天前
Cloudflare 免费 SSL 证书与兼容端口列表科普
网络协议·iphone·ssl
2601_9670195112 天前
关于SSL和TLS的常见问题解答
ssl