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 SnuffMaster23
SnuffMaster23

Registriert seit: 13. Feb 2006
Ort: Kempten
253 Beiträge
 
#1

Probleme mit Indy SMTP Komponenten

  Alt 11. Apr 2006, 22:10
Hi Leute,

ich bin auch mal wieder da und hab gleich zwei Fragen:

1. Wie kommt eine Mail vom TIdSMTP zu TIdSMTPServer?
2. Wie kommt die Mail von TIdSMTPServer weiter zum Server des Empfängers?

Ich ruf beim Client folgendes auf: Connect - Send - Disconnect.
Bei Send mault der Server immer "Bad command sequence".
Was will der Server denn noch hören, der Client kann ja sonst nix mehr!?!
Ich hab schon stundenlang ( ) die OH gewälzt und komm einfach nicht weiter.

Die zweite Frage ist wohl eher ein Informationsdefizit/Verständnisproblem.

Helft mir da bitte raus!

Snuffi
"Conspiracy is the poor man's mapping of the world" - Fredric Jameson
  Mit Zitat antworten Zitat
Benutzerbild von SnuffMaster23
SnuffMaster23

Registriert seit: 13. Feb 2006
Ort: Kempten
253 Beiträge
 
#2

Re: Probleme mit Indy SMTP Komponenten

  Alt 12. Apr 2006, 11:15
*push*

He Leute, was los??
So kenn ich euch ja gar nicht.
Weiß keiner, was ich da anstellen muss?

Snuffi
"Conspiracy is the poor man's mapping of the world" - Fredric Jameson
  Mit Zitat antworten Zitat
Benutzerbild von SnuffMaster23
SnuffMaster23

Registriert seit: 13. Feb 2006
Ort: Kempten
253 Beiträge
 
#3

Re: Probleme mit Indy SMTP Komponenten

  Alt 13. Apr 2006, 13:01
Sodala,

Die Antwort auf die zweite Frage hab ich mittlerweile (theoretisch). Nur wie finde ich einen Exchange-Server?

PS: Mögt ihr mich nicht mehr?
Ist das Problem so knifflig?
Hab ich den Titel schlecht formuliert?
"Conspiracy is the poor man's mapping of the world" - Fredric Jameson
  Mit Zitat antworten Zitat
Benutzerbild von inherited
inherited

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

Re: Probleme mit Indy SMTP Komponenten

  Alt 13. Apr 2006, 13:16
wie wärs ma mitn bissel qt
Nikolai Wyderka

SWIM SWIM HUNGRY!
Neuer Blog: hier!
  Mit Zitat antworten Zitat
Benutzerbild von SnuffMaster23
SnuffMaster23

Registriert seit: 13. Feb 2006
Ort: Kempten
253 Beiträge
 
#5

Re: Probleme mit Indy SMTP Komponenten

  Alt 13. Apr 2006, 13:23
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.
"Conspiracy is the poor man's mapping of the world" - Fredric Jameson
  Mit Zitat antworten Zitat
Benutzerbild von inherited
inherited

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

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
Benutzerbild von SnuffMaster23
SnuffMaster23

Registriert seit: 13. Feb 2006
Ort: Kempten
253 Beiträge
 
#7

Re: Probleme mit Indy SMTP Komponenten

  Alt 13. Apr 2006, 15:31
Das mit dem try ist mir klar, ist ja jetz bloß zum ausprobieren.

Und das Authenticate kann man laut OH weglassen, das macht Send wenn nötig.
Hab ich auch schon probiert, geht genausowenig.

trotzdem danke schonmal

Snuffi
"Conspiracy is the poor man's mapping of the world" - Fredric Jameson
  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 10:08 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz