Autor Beitrag
Dude566
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 30.01.09 13:01 
Hi,

ich habe ein Programm geschrieben welches Emails versenden soll, bisher nur kompatibel mit Web.de, wird aber noch erweitert.

Wenn ich dann alles ausgefüllt habe und die Email verschicken will, kommt nach kurzer Zeit folgende Meldung:

user defined image

Der Fehler wird im Code an der markierten Stelle angezeigt:
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdMessage, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdMessageClient, IdSMTP, StdCtrls;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    Label1: TLabel;
    Edit2: TEdit;
    Label2: TLabel;
    GroupBox2: TGroupBox;
    Edit3: TEdit;
    Label3: TLabel;
    GroupBox3: TGroupBox;
    Edit4: TEdit;
    Label4: TLabel;
    Button1: TButton;
    Button2: TButton;
    IdSMTP1: TIdSMTP;
    IdMessage1: TIdMessage;
    Memo1: TMemo;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
const
  SMTPServer = 'smtp.web.de';
  SMTPPort = 25;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
     with idMessage1 do begin
      Body.Assign(Memo1.lines);
      From.Text := Edit1.Text;
      Subject := 'Betreff[/img]';
      Recipients.EmailAddresses := Edit3.Text;
      CCList.EmailAddresses := '';
      BCCList.EmailAddresses := '';
      Priority := mpNormal;
     end;

     with idSMTP1 do begin
      Username := Edit1.Text;
      Password := Edit2.Text;
      Port := SMTPPort;
      Host := SMTPServer;
      try
        Connect;
        Send (idMessage1);
      except
       ShowMessage ('Es ist ein Fehler aufgetreten');
      end;
      Disconnect;
     end;
end;

end.


Gruß

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 30.01.09 13:14 
ich glaube bei Web.de ist es so, dass man sich erst via POP3 zum Server verbinden muss. Dann erst kann man via SMTP eMails versenden.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 30.01.09 13:24 
Ich habe mich an das Tutorial hier gehalten: progger-ag.de/index.php?page=tutdelphimail

In dem Video scheint es ja zu klappen. :roll:

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: Fr 30.01.09 14:58 
Also meiner Meinung nach sagt die Fehlermeldung alles aus. "POP3 logon too old" und in Verbindung mit matzes Kommentar, ergibt das Sinn. Wieso probierst du nicht einfach ein POP3-Login aus?

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 30.01.09 17:34 
Ok wenn du mir sagen kannst wie dies geht. Oder meinst du garkein smtp.web.de sondern pop3.web.de?

Oder ist da eine ganz andere Verbindung gefragt?

I need help.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Fr 30.01.09 17:38 
Du müsstest kurz eine Verbindung mit TIdPop3 herstellen um dich zu authentifizieren und dann deinen Code ausführen.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 30.01.09 17:50 
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
const
  POP3Server = 'pop3.web.de';
  SMTPPort = 25;

with idPOP3Server1 do begin
      Username := Edit1.Text;
      Password := Edit2.Text;
      Port := SMTPPort;
      Host := POP3Server;
      try
        Connect;
        Send (idMessage1);
      except
       ShowMessage ('Es ist ein Fehler aufgetreten');
      end;
      Disconnect;
     end;


So?

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Fr 30.01.09 18:03 
Nein.
Deine SMTP Routine bleibt wie sie ist. Nur davor eine Verbindung via IdPOP3 aufbauen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Fr 30.01.09 18:07 
Ok, nur wie?

Da ich das ganze nach einem Tutorial gemacht habe, verstehe ich noch nicht so ganz wie ich dann nur kurz eine Verbindung mit dem POP3Server aufbauen kann.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: Mo 02.02.09 10:12 
Einfach mit der Komponente IdPop3

_________________
In the beginning was the word.
And the word was content-type: text/plain.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Mo 02.02.09 19:34 
Also und was soll in dem Code stehen? Ich habe es so wie mit SMTP gemacht, doch das funktioniere nicht.

Was mache ich falsch?
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
with idPOP3 do begin
      Username := Edit1.Text;
      Password := Edit2.Text;
      Port := 25;
      Host := 'pop3.web.de';
      try
        Connect;
      except
       ShowMessage ('Es ist ein Fehler aufgetreten');
      end;
      Disconnect;
     end;


Da sind dann aufeinmal Username und Password undefinierte Bezeichner obwohl sie ohne das vorher Prima gingen.

Und bei do begin ist auch ein fehler, "'.' erwartet aber 'do' gefunden". :shock: :?:

Bitte helft mir, ist doch fast fertig. ;)

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Mo 02.02.09 20:18 
idPop3?
Bist du sicher, dass deine Komponente so heißt, und nicht idpop31?
Weil, idpop3 ist gleichzeitig der Name von der Unit, wo die Komponente definiert ist. Somit kann Delphi das nicht auseinander halten.
Nenn deine Komponente um und gut ist.

_________________
PROGRAMMER: A device for converting coffee into software.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Mo 02.02.09 20:41 
Das Programm startet jetzt, und es stürtzt viel später ab. ^^

Aber versenden will es immer noch nicht:
user defined image

Was bedeutet denn die Meldung?

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 03.02.09 14:02 
Hack mal 10051 in die Suchmaschine deiner Wahl.
Aber im Text steht doch schon der Fehler: Das Netzwerk ist nicht erreichbar.
Vllt. hast du während des Testens keine Internetverbindung, dich bei der IP vertippt, kA.

_________________
PROGRAMMER: A device for converting coffee into software.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 03.02.09 14:23 
Ok habe jetzt mal nach dem Fehler 10051 gesucht, und verstehe das ganze nicht.

Wieso kann denn jetzt aufeinmal die Verbindung nicht hergestellt werden, es ging doch vorher?

support.ipswitch.com...SK-19980714-EM17.htm

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Xentar
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2077
Erhaltene Danke: 2

Win XP
Delphi 5 Ent., Delphi 2007 Prof
BeitragVerfasst: Di 03.02.09 14:25 
Zeig mal den gesamten Quellcode..

_________________
PROGRAMMER: A device for converting coffee into software.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 03.02.09 15:21 
ausblenden volle Höhe Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
unit Unit1;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, IdMessage, IdBaseComponent, IdComponent, IdTCPConnection,
  IdTCPClient, IdMessageClient, IdSMTP, StdCtrls, jpeg, ExtCtrls, IdPOP3;

type
  TForm1 = class(TForm)
    GroupBox1: TGroupBox;
    Edit1: TEdit;
    Label1: TLabel;
    Edit2: TEdit;
    Label2: TLabel;
    GroupBox2: TGroupBox;
    Edit3: TEdit;
    Label3: TLabel;
    GroupBox3: TGroupBox;
    Edit4: TEdit;
    Label4: TLabel;
    Button1: TButton;
    Button2: TButton;
    IdSMTP1: TIdSMTP;
    IdMessage1: TIdMessage;
    Memo1: TMemo;
    Image1: TImage;
    Label5: TLabel;
    Label6: TLabel;
    IdPOP31: TIdPOP3;
    procedure Button1Click(Sender: TObject);
  private
    { Private-Deklarationen }
  public
    { Public-Deklarationen }
  end;

var
  Form1: TForm1;
const
  SMTPServer = 'smtp.web.de';
  SMTPPort = 25;

implementation

{$R *.dfm}

procedure TForm1.Button1Click(Sender: TObject);
begin
     with idMessage1 do begin
      Body.Assign(Memo1.lines);
      From.Text := Edit1.Text;
      Subject := 'Betreff';
      Recipients.EmailAddresses := Edit3.Text;
      CCList.EmailAddresses := '';
      BCCList.EmailAddresses := '';
      Priority := mpNormal;
     end;

     with idPOP31 do begin
      Username := Edit1.Text;
      Password := Edit2.Text;
      Port := 25;
      Host := 'pop3.web.de';
      try
        Connect;
      except
       ShowMessage ('Es ist ein Fehler aufgetreten');
      end;
      Disconnect;
     end;

     with idSMTP1 do begin
      Username := Edit1.Text;
      Password := Edit2.Text;
      Port := SMTPPort;
      Host := SMTPServer;
      try
        Connect;
        Send (idMessage1);
      except
       ShowMessage ('Es ist ein Fehler aufgetreten');
      end;
      Disconnect;
     end;
end;

end.

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
jaenicke
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 19346
Erhaltene Danke: 1754

W11 x64 (Chrome, Edge)
Delphi 12 Pro, C# (VS 2022), JS/HTML, Java (NB), PHP, Lazarus
BeitragVerfasst: Di 03.02.09 15:24 
Hat POP3 (zumindest bei web.de) nicht Port 110?
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Di 03.02.09 16:08 
Scheinbar lags wirklich am falschen Port, habe es ausprobiert und es läuft ohne Probleme.

Danke für die Hilfe!

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.
Dude566 Threadstarter
ontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic starofftopic star
Beiträge: 1592
Erhaltene Danke: 79

W8, W7 (Chrome, FF, IE)
Delphi XE2 Pro, Eclipse Juno, VS2012
BeitragVerfasst: Sa 07.02.09 17:53 
Wie erstelle ich denn so ein Button?

user defined image

Also wenn man drauf klickt erscheint darunter so ein Menü wo ich dann wieder Radiobuttons einbauen möchte.

Wie gehts?

_________________
Es gibt 10 Gruppen von Menschen: diejenigen, die das Binärsystem verstehen, und die anderen.