Текущий архив: 2003.10.02;
Скачать: CL | DM;
Вниз
не могу разобраться с IdSmtp Найти похожие ветки
← →
ilka (2003-08-06 15:35) [0]Привет мастерам.Я никак не могу разобраться с IdSmtp, напишите plz небольшой пример. Как(чем) заполнить поля?
← →
Е-Моё имя (2003-08-06 16:02) [1]есть стандартные наполнители
заполняешь адрес сервера, пользователя, подключаешься, отправляешь сообщение
хитростей нет
← →
Disel (2003-08-06 16:03) [2]var
SMTP: TIdSMTP;
IdM: TIdMessage;
...
begin
SMTP:=TIdSMTP.Create(nil);
IdM:=TIdMessage.Create(nil);
with IdM do
begin
Body.Append(text);
From.Text := FromAddress;
Recipients.EMailAddresses := ToAddress; { To }
Subject := Subject_;
CCList.EMailAddresses := CcL;
BccList.EMailAddresses := BccL;
CharSet:=Charset;
//
Priority := TIdMessagePriority(mpHighest); { Message Priority }
end;
case StrToInt(AuthType) of
0: begin
SMTP.AuthenticationType := atNone;
end;
1: begin
SMTP.AuthenticationType := atLogin; {Simple Login}
SMTP.UserId:=login;
SMTP.Password:=passward;
end;
end;
SMTP.Port:=StrToInt(port);
SMTP.Host:=host;
{now we send the message}
SMTP.Connect;
try
( IdM) var
SMTP: TIdSMTP;
IdM: TIdMessage;
...
begin
SMTP:=TIdSMTP.Create(nil);
IdM:=TIdMessage.Create(nil);
with IdM do
begin
Body.Append(text);
From.Text := FromAddress;
Recipients.EMailAddresses := ToAddress; { To }
Subject := Subject_;
CCList.EMailAddresses := CcL;
BccList.EMailAddresses := BccL;
CharSet:=Charset;
//
Priority := TIdMessagePriority(mpHighest); { Message Priority }
end;
case StrToInt(AuthType) of
0: begin
SMTP.AuthenticationType := atNone;
end;
1: begin
SMTP.AuthenticationType := atLogin; {Simple Login}
SMTP.UserId:=login;
SMTP.Password:=passward;
end;
end;
SMTP.Port:=StrToInt(port);
SMTP.Host:=host;
{now we send the message}
SMTP.Connect;
try
SMTP.Send(IdM);
finally
SMTP.Disconnect;
end;
SMTP.Free;
IdM.Free;
end;
← →
Е-Моё имя (2003-08-06 16:07) [3]во как! еще бы единственный комментарий в правильное место и обработать ошибку подключения ))
← →
ilka (2003-08-06 16:24) [4]Огромное спасибо
Страницы: 1 вся ветка
Текущий архив: 2003.10.02;
Скачать: CL | DM;
Память: 0.45 MB
Время: 0.008 c