想问一下在delphi7里怎样实现自动发邮件的功能

想问一下在delphi7里怎样实现自动发邮件的功能 Delphi / Windows SDK/API
http://www.delphi2007.net/DelphiNetwork/html/delphi_20061212105758143.html
想问一下在delphi7里怎样实现如下功能:  
      把messagebox发出的提示信息,自动通过邮件的方式发给某一个收件人!TKS!!!

IdSMTP1.AuthenticationType   :=   atNone;  
   
  IdSMTP1.Connect;  
   
  try   if  
   
        IdSMTP1.AuthSchemesSupported.IndexOf('LOGIN')>-1   then  
   
        begin  
   
            IdSMTP1.AuthenticationType   :=   atLogin;  
   
            IdSMTP1.Authenticate;  
   
        end;  
   
        IdSMTP1.Send(IdMessage1);  
   
  finally  
   
        IdSMTP1.Disconnect;  
   
  end;  
 

顶.

procedure   TForm1.SendEmail(EAddress:   String;SContent:string);             //發   Mail  
  begin  
      try  
          IdSMTP1.Host:='192.168.30.13';//smtp   Server   KSMAIL03     '192.168.30.13'  
          IdSMTP1.Port:=25;       //SMTP   端口  
          IdSMTP1.Username:='';  
          IdSMTP1.Password:='';  
          IdSMTP1.Connect();  
      except  
          exit;  
      end;  
      try  
          IdMessage1.Body.Clear;  
          IdMessage1.Body.Add(SContent);       //Content  
          IdMessage1.From.Text:='WebApps@coretronic.com.cn';       //From  
          IdMessage1.Recipients.EMailAddresses:=Trim(EAddress);  
          IdMessage1.Subject:='未刷卡記錄通知';         //Title  
          IdSMTP1.Send(IdMessage1);  
      finally  
          IdSMTP1.Disconnect;  
      end;  
  end;

IdSMTP

转载于:https://www.cnblogs.com/delphi2007/archive/2008/10/28/1321022.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值