AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Netzwerke Delphi: E-Mail-Versand / E-Mail-Formatierung
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi: E-Mail-Versand / E-Mail-Formatierung

Ein Thema von SvenLittkowski · begonnen am 30. Jan 2011 · letzter Beitrag vom 7. Feb 2011
Antwort Antwort
SvenLittkowski

Registriert seit: 18. Dez 2004
98 Beiträge
 
#1

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 03:49
Hey, vielen Dank!

Wie kommt's, daß Du oft beide Sprachen verwendest (Englisch und Deutsch)?
  Mit Zitat antworten Zitat
Mike_

Registriert seit: 26. Mär 2008
98 Beiträge
 
Delphi 2007 Professional
 
#2

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 04:07
Im Anhang findest du die funktionierende Source.

Falls du es Anderen zur Verfügung stellen möchtest, bau dir noch ein Try...Except ein.

Hey, vielen Dank!

Wie kommt's, daß Du oft beide Sprachen verwendest (Englisch und Deutsch)?
Mir war einfach danach in deinem Thread.

Tip:
If you post sourcecode of an application, trim it.
Drop useless code.

Exempli gratia:
Delphi-Quellcode:
LabelStatus.Caption:='Connecting...'; //…then show the message
LabelStatus.Hint:='Connecting...'; //…then show the message
Label ZYX
Angehängte Dateien
Dateityp: zip GMail_SendIt.zip (690,2 KB, 31x aufgerufen)
Delphi-Nachwuchs

Geändert von Mike_ ( 6. Feb 2011 um 04:35 Uhr)
  Mit Zitat antworten Zitat
SvenLittkowski

Registriert seit: 18. Dez 2004
98 Beiträge
 
#3

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 06:47
Beim Kompilieren das folgende:

Zitat von Mein Delphi 7:
[Hint] IdIOHandlerStack.pas(222): Overriding virtual method 'TIdIOHandlerStack.ConnectClient' has lower visibility (protected) than base class 'TIdIOHandlerSocket' (public)
[Error] IdIOHandlerStack.pas(222): Declaration of 'ConnectClient' differs from previous declaration
[Error] IdIOHandlerStack.pas(223): Method 'ReadFromSource' not found in base class
[Error] IdIOHandlerStack.pas(227): Method 'CheckForDataOnSource' not found in base class
[Error] IdIOHandlerStack.pas(228): Method 'CheckForDisconnect' not found in base class
[Error] IdIOHandlerStack.pas(235): Undeclared identifier: 'TIdBytes'
[Error] IdIOHandlerStack.pas(234): Method 'WriteDirect' not found in base class
[Error] IdIOHandlerStack.pas(238): Property 'ReadTimeout' does not exist in base class
[Error] IdIOHandlerStack.pas(313): Undeclared identifier: 'Toss'
[Error] IdIOHandlerStack.pas(319): Undeclared identifier: 'Toss'
[Error] IdIOHandlerStack.pas(329): Incompatible types
[Error] IdIOHandlerStack.pas(330): Undeclared identifier: 'FTransparentProxy'
[Error] IdIOHandlerStack.pas(330): Incompatible types
[Error] IdIOHandlerStack.pas(331): 'THEN' expected but identifier 'Enabled' found
[Error] IdIOHandlerStack.pas(332): Missing operator or semicolon
[Error] IdIOHandlerStack.pas(333): Missing operator or semicolon
[Error] IdIOHandlerStack.pas(347): Too many actual parameters
[Error] IdIOHandlerStack.pas(359): Undeclared identifier: 'ConnectTimeout'
[Warning] IdIOHandlerStack.pas(359): Comparing signed and unsigned types - widened both operands
[Error] IdIOHandlerStack.pas(368): Incompatible types
[Error] IdIOHandlerStack.pas(369): 'THEN' expected but identifier 'Enabled' found
[Error] IdIOHandlerStack.pas(370): Missing operator or semicolon
[Error] IdIOHandlerStack.pas(389): Undeclared identifier: 'IfFalse'
[Error] IdIOHandlerStack.pas(390): Incompatible types
[Error] IdIOHandlerStack.pas(397): Undeclared identifier: 'FClosedGracefully'
[Error] IdIOHandlerStack.pas(417): Cannot read a write-only property
[Error] IdIOHandlerStack.pas(420): Cannot read a write-only property
[Error] IdIOHandlerStack.pas(426): Undeclared identifier: 'BindingAllocated'
[Error] IdIOHandlerStack.pas(430): Undeclared identifier: 'FRecvBuffer'
[Error] IdIOHandlerStack.pas(430): Incompatible types
[Error] IdIOHandlerStack.pas(435): Incompatible types
[Error] IdIOHandlerStack.pas(436): Undeclared identifier: 'Receive'
[Error] IdIOHandlerStack.pas(437): Incompatible types
[Error] IdIOHandlerStack.pas(439): Undeclared identifier: 'Intercept'
[Error] IdIOHandlerStack.pas(439): Operator not applicable to this operand type
[Error] IdIOHandlerStack.pas(440): Missing operator or semicolon
[Error] IdIOHandlerStack.pas(441): Incompatible types
[Error] IdIOHandlerStack.pas(451): Undeclared identifier: 'InputBuffer'
[Error] IdIOHandlerStack.pas(451): Missing operator or semicolon
[Error] IdIOHandlerStack.pas(455): Undeclared identifier: 'Toss'
[Error] IdIOHandlerStack.pas(459): Undeclared identifier: 'IfTrue'
[Error] IdIOHandlerStack.pas(461): Undeclared identifier: 'FClosedGracefully'
[Error] IdIOHandlerStack.pas(467): Undeclared identifier: 'IfTrue'
[Error] IdIOHandlerStack.pas(471): Operator not applicable to this operand type
[Error] IdIOHandlerStack.pas(486): Undeclared identifier: 'ClosedGracefully'
[Error] IdIOHandlerStack.pas(487): Undeclared identifier: 'BindingAllocated'
[Error] IdIOHandlerStack.pas(499): Undeclared identifier: 'FInputBuffer'
[Error] IdIOHandlerStack.pas(499): Incompatible types
[Error] IdIOHandlerStack.pas(500): ')' expected but identifier 'Size' found
[Error] IdIOHandlerStack.pas(502): Undeclared identifier: 'RaiseConnClosedGracefully'
[Error] IdIOHandlerStack.pas(542): Undeclared identifier: 'SetDefaultClass'
[Fatal Error] Unit2.pas(7): Could not compile used unit 'IdIOHandlerStack.pas'
Liegt's vieleicht an unterschiedlichen Delphi-Versionen?

Aber das spielt letztendlich keine so große Rolle. Ich habe einfach Deinen Code kopiert und in mein Programm eingefügt, und meinen eigenen Code erstmal disabled. So, Programm gestartet und Mailknopf gedrückt und - Programm stehengeblieben...

Ich habe dann alles disabled, und dann von vorne und von hinten zeilenweise den Code enabled. Ich fand heraus, daß der Befehl "IdSMTP.Connect;" wohl das Erstarren des Programmes bewirkt. Was kann das verursachen? Mangeldne Kommunikation zum Google-Server? Zu langsame Kommunikation? Falsche Einstellungen des GMail-Kontos? Werde nochmal das Programm laufen lassen, dieses Mal aber mehrere Minuten warten, ob sich die Starre wieder löst.

UPDATE

Interessantes Ergebnis: GMail riet, "465" als Port zu verwenden, doch erst als ich Deine "587" verwendete, hing sich das Programm nicht mehr auf. Jedoch bekomme ich nun einen SSL-Fehler. Folgende Zeile wird markiert:

raise EIdOSSLConnectError.Create(RSSSLConnectError); ("Error connecting with SSL") Datei: IDSSLOpenSSL, bei mir Zeile 1849

Geändert von SvenLittkowski ( 6. Feb 2011 um 07:14 Uhr)
  Mit Zitat antworten Zitat
hathor
(Gast)

n/a Beiträge
 
#4

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 06:54
Bei mir gibt es keine Probleme beim Compilieren.
(DELPHI 2007)

Allerdings muss man die überflüssigen Files löschen:
Project1.dproj
Project1.dproj.local
Project1.identcache

Geändert von hathor ( 6. Feb 2011 um 06:58 Uhr)
  Mit Zitat antworten Zitat
SvenLittkowski

Registriert seit: 18. Dez 2004
98 Beiträge
 
#5

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 07:29
hathor, vielen ank.

Aber bei mir gibt es keine dieser doppelte Dateien im Verzeichnis meiner neuen Anwendung.

Ich schlafe erstmal über dieses Problem, ist Nacht hier...
  Mit Zitat antworten Zitat
Mike_

Registriert seit: 26. Mär 2008
98 Beiträge
 
Delphi 2007 Professional
 
#6

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 13:15
Step by Step:

Ich denke nicht dass es an der Delphi Version liegt, sondern dass du den Quellcode kopiert hast und ein paar Propertys von mir nicht übernommen hast, welch eich direkt bei den Komponenten auf der Form eingestellt habe (Und diese somit nicht in der .pas stehen).

################################################## ############
# GoogleMail SendIt v.0.1
#
# Little Tutorial how to send Mails through Gmail with Delphi
# Greetings flying out to limebulls.com
################################################## ############

1.) Put the following components on your application:

a -> TButton
b -> TIdSSLIOHandlerSocketOpenSSL
c -> TIdMessage
d -> TIdSMTP

Leave the "standard names". (!)

2.) Set the propertys to the following components of you app. :

IdSMTP1 -> AuthType -> atDefault
IdSMTP1 -> IOHandler -> IdSSLIOHandlerSocketOpenSSL1
IdSMTP1 -> UseTLS -> utUseRequireTLS
IdSSLIOHandlerSocketOpenSSL1 -> (TIdSSLOptions) -> Method -> sslvSSLv3
(v.2 is no longer available @ google mail server)

3.) Finish it !

Doubleclick your Button on the form and paste :

Delphi-Quellcode:
IdSMTP1.Host := 'smtp.googlemail.com';
IdSMTP1.Port := 587;
IdSMTP1.Username := 'USERNAME'; //WITHOUT @gmail.com
IdSMTP1.Password := 'PASSWORD';
IdSMTP1.Connect;

IdMessage1.From.Name := 'Bill';

IdMessage1.From.Address := 'YOURMAIL@googlemail.com';
IdMessage1.ReplyTo.Add.Address := 'YOURMAIL@googlemail.com';
IdMessage1.Recipients.Add.Address := 'YOURMAL@googlemail.com';

IdMessage1.Subject := 'Betreff';
IdMessage1.Body.Text := 'Test';
IdSMTP1.Send(IdMessage1);
IdSMTP1.Disconnect;
You´re done !
Delphi-Nachwuchs

Geändert von Mike_ ( 6. Feb 2011 um 13:36 Uhr)
  Mit Zitat antworten Zitat
SvenLittkowski

Registriert seit: 18. Dez 2004
98 Beiträge
 
#7

AW: Delphi: E-Mail-Versand / E-Mail-Formatierung

  Alt 6. Feb 2011, 16:29
Ha! Es funktioniert! Es funktioniert!

Hey Mike, vielen Dank für Deine Hilfe. Ich sollte sagen, unermüdliche Hilfe. Mir ist aufgefallen in all den Postings von Dir, daß Du eine sehr gute Art hast, das Problem, wie aber auch menschliche Schwächen anzugehen. Mit den menschlichen Schwächen meine ich zum Beispiel, Deinen Code kopiert zu haben aus Deiner Anwendung aber nicht die Eigenschaften der Indy-Komponenten. Wann immer ich Fehler auf meiner Seite gemacht hatte, hast Du sie gut erkannt.

Ich frage mich, ob Du im Lehrbereich arbeitest oder einfach nur ein sehr gutes Verständnis von Menschen hast. Mir hat jedenfalls Deine Art des Helfens gut gefallen. Anders als bei vielen, vielen anderen Leuten. Zudem hast Du Dir sehr viel Zeit genommen.

Außerdem habe ich ein tiefes Verständnis zu Delphi bemerkt, soweit ich es in diesen wenigen Postings bemerken konnte.

Also, vielen Dank nochmal. Ich werde nun mein Programm, nachdem es grundlegend E-Mails versenden kann, nun noch etwas erweitern, damit die ganze Sache noch besser in der Bedienung wird.

Wie kann ich Leerzeilen in die Message einfügen?
Wie kann ich die Message im HTML-Format gestalten?
Vor allem: wie kann ich LabelStatus.Caption die jeweilige Aktivität anzeigen lassen?

Geändert von SvenLittkowski ( 6. Feb 2011 um 17:45 Uhr)
  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 22:50 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