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

相关推荐
云-缩影3 天前
拆解微信小程序后端架构:ECS、RDS、SSL 和 VPC 怎么配合
微信小程序·架构·ssl
DevLoom_6 天前
macOS 命令行 curl/git 报 SSL 证书错误?eMudhra 事件完整修复指南
git·macos·ssl
zxanz17 天前
国密 SM2 SSL 证书和国际证书怎么选,一文理清差异
https·ssl
RacentCLM7 天前
证书即服务CaaS:从申请、续期到部署的自动化链路拆解
运维·数据库·自动化·ssl
HoneyMoose12 天前
Ubuntu Apache 配置多站点提示 SSL 错误
ubuntu·apache·ssl
AnTrust12 天前
代码签名证书品牌价格对比:DigiCert、GlobalSign、Comodo、Certum怎么选
运维·服务器·ssl
zxanz112 天前
免费 SSL 证书的隐性成本:续期压力、稳定性与商业风险评估
网络·网络协议·ssl
福娃筱欢12 天前
金仓数据库配置SSL双向认证
数据库·网络协议·ssl
fb_1234513 天前
K8s部署带SSL的WordPress博客
容器·kubernetes·ssl
zxanz113 天前
SSL 证书该怎么申请?操作复杂吗?
网络·网络协议·ssl