Добрый день . Помогите пожалуйста пробую отправить почту самому себе - выдаёт ошибку "Syntactically invalid EHLO argument(s)" , почта mail.ru
| Код | procedure TForm1.Button1Click(Sender: TObject); var IdAttachment1:TIdAttachment; fd:TWin32FindData; h:cardinal; pach:string; begin //вкладка indy clients, ставишь на форму IdSMTP (ящик синий такой нарисован) //вкладка indy misc, ставишь IdMessage IdMessage1.Body.Text:='текст'; IdMessage1.From.Text:='[email protected]'; IdMessage1.Recipients.Add.Text:='[email protected]'; IdMessage1.Subject:='тема сообщения'; //прикрепить файл: fillchar(fd,sizeof(fd),0); fd.dwFileAttributes:=0;//faHidden or faSysFile; pach:='c:\temp\'; h:=FindFirstFile(pchar(pach+'*.xml'), fd); if h<>0 then repeat TIdAttachment.Create(IdMessage1.MessageParts,pchar(pach+fd.cFileName)); until not FindNextFile(h,fd); IdSMTP1.AuthenticationType := atLogin; IdSMTP1.Host:='smtp.mail.ru'; IdSMTP1.Username:='[email protected]'; IdSMTP1.Password:='1234'; IdSMTP1.Connect(); if IdSMTP1.Connected then IdSMTP1.Send(IdMessage1); IdSMTP1.Disconnect; end;
|
|