Napisałem program do wysyłania maili. Kiedy chcę wysłać maila pokazuje mi się taki błąd:
Socket Error # 10049 Cannot assign requested address.
A tak wygląda mój program
procedure TForm1.btnSendClick(Sender: TObject);
var
I : Integer;
begin
Message.From.Address := edtEmail.Text;
Message.From.Name := edtLogin.Text;
SMTP.UserId := edtLogin.Text;
SMTP.Password := edtHaslo.Text;
SMTP.Host := edtHost.Text;
SMTP.Port := StrToInt(edtPort.Text);
SMTP.AuthenticationType := atLogin;
for I := 1 to StrToInt(edtIle.Text) do
begin
Message.ReceiptRecipient.Address := edtTo.Text;
Message.Body.Assign(memMsg.Lines);
Message.Subject := edtSubject.Text;
SMTP.Connect;
SMTP.Authenticate;
SMTP.Send(Message);
SMTP.Disconnect;
end;
end;
Czytałem tematy na forum i nie znalazłem odpowiedzi na to pytanie. :/