Форум: "Сети";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
ВнизПочтовая программа Найти похожие ветки
← →
copyr25 (2002-02-09 02:43) [2]unit Unit1;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
NMsmtp, Psock, NMpop3, StdCtrls;
type
TForm1 = class(TForm)
Button1: TButton;
Button2: TButton;
NMPOP31: TNMPOP3;
NMSMTP1: TNMSMTP;
procedure Button1Click(Sender: TObject);
procedure Button2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
oLogon: TNMPop3;
oMail: TNMSmtp;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
oLogon := TNMPop3.Create(self);
try
with oLogon do begin
Host := "pop.mail.yahoo.com";
UserID := "copyr25";
Password := "password";
end;
oLogon.Connect;
// Delay
oLogon.Disconnect;
finally
oLogon.Free;
end;
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
oMail := TNMSmtp.Create(self);
with oMail do
begin
try
Host := "smtp.mail.yahoo.com";
Port := 25;
UserID := "copyr25";
Connect;
SubType := mtHTML;
{ set all other properties, e. g. FromName, FromAddress, ReplyTo, Subject, etc }
PostMessage.FromAddress := "copyr25@yahoo.com";
PostMessage.FromName := "Name";
PostMessage.Subject := "No Subject";
PostMessage.ToAddress.Add("copyr25@yahoo.com");
PostMessage.Body.Add("<html> <head> </head>");
PostMessage.Body.Add("<body> My 1st html - message </body>");
PostMessage.Body.Add("</html>");
Connect;
SendMail;
Disconnect;
finally
Free;
end;
end;
end;
end.
Страницы: 1 вся ветка
Форум: "Сети";
Текущий архив: 2002.04.22;
Скачать: [xml.tar.bz2];
Память: 0.44 MB
Время: 0.006 c