Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1228594
  • 博文数量: 788
  • 博客积分: 4000
  • 博客等级: 上校
  • 技术积分: 7005
  • 用 户 组: 普通用户
  • 注册时间: 2008-08-19 15:52
文章存档

2017年(81)

2011年(1)

2009年(369)

2008年(337)

分类:

2008-10-28 10:00:15



想问一下在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



[新闻]Facebook开放Scribe源代码 改善运行效率
博客园首页 社区 新闻频道 小组 博问 网摘 闪存
阅读(935) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~