Siemka. Teoretycznie wszystko działa. Ba, udało mi się wysłać nawet 3 maile, ale potem przestało działać, nie wiem dlaczego. A więc, używam (do wysyłania maili) Indy 10
Procedurka wygląda tak:
IdSMTP1.AuthType:= satSASL;
IdSMTP1.Host := 'poczta.interia.pl';
IdSMTP1.Port := 587;
IdSMTP1.Username := 'login';
IdSMTP1.Password := 'pass';
IdSMTP1.Connect;
Sleep(1000);
if IdSMTP1.Connected then
IdMessage1.From.Address:= '[email protected]';
IdMessage1.Recipients.EMailAddresses:= 'mail_odbierajacego';
IdMessage1.Subject:= 'temat';
IdMessage1.Body.Append('wiadomosc');
try
IdSMTP1.Send(IdMessage1);
Sleep(1000);
finally
IdSMTP1.Disconnect;
Application.Terminate;
Zgodnie z instrukcją, zrobiłem mechanizm SASL na Login, czyli uwierzytelnianie powinno działać, lecz nie działa. Ciągle wypada błąd, że brak uwierzytelniania.
Oto instrukcja, której się trzymałem:
- Drop a SASL mechanism component on your form. Those components are located on the new Indy SASL tab in the component palette.
- In TIdSMTP, set the AuthType property to atSASL.
- In TIdSMTP, click the button beside the SASLMechanisms property. An editor will appear.
- Select the SASL mechanism components you wish to use with TIdSMTP from the available listbox.
- Click the RIght arrow to move those to the Assigned listbox.
- Click Ok when you are finished.