AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi Probleme mit Indy SMTP Komponenten
Thema durchsuchen
Ansicht
Themen-Optionen

Probleme mit Indy SMTP Komponenten

Offene Frage von "SnuffMaster23"
Ein Thema von SnuffMaster23 · begonnen am 11. Apr 2006 · letzter Beitrag vom 13. Apr 2006
Antwort Antwort
Benutzerbild von inherited
inherited

Registriert seit: 19. Dez 2005
Ort: Rosdorf
2.022 Beiträge
 
Turbo Delphi für Win32
 
#1

Re: Probleme mit Indy SMTP Komponenten

  Alt 13. Apr 2006, 15:18
Zitat von SnuffMaster23:
Nagut, das hier ist mein "Senden"-Knopf:
Delphi-Quellcode:
procedure TForm1.Button1Click(Sender: TObject);
var
  Adresses: string;
begin
  with IdMessage1 do
  begin
    Clear;
    From.Address := Edit1.Text;

    Adresses := Edit2.Text;
    repeat
      Recipients.Add.Address := copy(Adresses, 0, IfThen(Pos(';', Adresses) > 0, Pos(';', Adresses), Length(Adresses)));
      Adresses := copy(Adresses, Pos(';', Adresses) + 1, Length(Adresses));
    until Pos(';', Adresses) = 0;

    Adresses := Edit3.Text;
    repeat
      BccList.Add.Address := copy(Adresses, 0, IfThen(Pos(';', Adresses) > 0, Pos(';', Adresses), Length(Adresses)));
      Adresses := copy(Adresses, Pos(';', Adresses) + 1, Length(Adresses));
    until Pos(';', Adresses) = 0;

    ContentType := 'text/' + IfThen(RadioButton1.Checked, 'plain', 'html');
    Body := Memo1.Lines;
    Sender := From;
    Subject := Edit4.Text;

    case ComboBox1.ItemIndex of
      0: Priority := mpHighest;
      1: Priority := mpHigh;
      2: Priority := mpNormal;
      3: Priority := mpLow;
      4: Priority := mpLowest;
    end;

    GenerateHeader;
  end;

  IdSMTP1.MailAgent := IfThen(Edit5.Text = '', 'mySMTP', Edit5.Text);
  IdSMTP1.Connect;
  IdSMTP1.Authenticate;
  IdSMTP1.Send(IdMessage1);
  IdSMTP1.Disconnect;
end;
Und das hier ist der Server:
Delphi-Quellcode:
procedure TForm1.IdSMTPServer1UserLogin(ASender: TIdSMTPServerContext;
  const AUsername, APassword: string; var VAuthenticated: Boolean);
begin
  if (AUsername = 'mySMTP') and (APassword = 'mySMTP') then
    VAuthenticated := true;
end;

procedure TForm1.IdSMTPServer1Connect(AContext: TIdContext);
begin
  Context := AContext;
end;

procedure TForm1.IdSMTPServer1MsgReceive(ASender: TIdSMTPServerContext;
  AMsg: TStream; var LAction: TIdDataReply);
begin
  LAction := dOk;
end;

procedure TForm1.IdSMTPServer1MailFrom(ASender: TIdSMTPServerContext;
  const AAddress: string; var VAction: TIdMailFromReply);
begin
  VAction := mAccept;
end;

procedure TForm1.IdSMTPServer1Execute(AContext: TIdContext);
begin
//
end;

procedure TForm1.IdSMTPServer1RcptTo(ASender: TIdSMTPServerContext;
  const AAddress: string; var VAction: TIdRCPToReply; var VForward: string);
begin
  VForward := 'Is ja gut...';
  VAction := rAddressOk;
end;

<EDIT>: Mit Telnet kann ich von Hand Mails an den Server schicken.
hmmmm, sieht ganz richtig aus,


besser ist hier
Delphi-Quellcode:
  IdSMTP1.Connect;
  IdSMTP1.Authenticate;
  IdSMTP1.Send(IdMessage1);
  IdSMTP1.Disconnect;
das da
Delphi-Quellcode:
  IdSMTP1.Connect;
  try
    IdSMTP1.Send(IdMessage);
  finally
    IdSMTP1.Disconnect;
  end;
aber sonst kann ich keinen fehler bzw etwas vergessenes entdecken
überprüf noch mal IdSMTP1.AuthenticationType, sonst weiss ichs auch nich.
Am Server wirts ja nich liegen, wenns via Telnet klappt
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 13:22 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz