Delphi 6 -аас email илгээх хамгийн амархан арга
var Smtp: TNMSMTP;
.....
(*************** SENDING EMAIL *****************)
if not Smtp.Connected then begin
Smtp.Host:=EmailServerHost;
Smtp.Port:=EmailServerPort;
Smtp.UserID:=EmailFromAddress;
Smtp.Connect;
end;
if Smtp.Connected then begin
with Smtp.PostMessage do begin
FromAddress:=EmailFromAddress;
ToAddress.Text:=EmailToAddress;
Body.Text:=EmailBody;
Subject:=EmailSubject;
if FileExists(ExportFileName) then Attachments.Add(ExportFileName);
end;
Smtp.SendMail;
end;
.....
No comments:
Post a Comment