Autor Beitrag
Jagg
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 05.07.02 08:48 
Hallo !

ich möchte eine E-Mail versenden !
Soll ich besser shellexecute oder clientsocket verwenden ???
wenn shellexecute,kann mir jemand die syntax dazu geben ??? und auch bei clientsocket !

Jagg !!!!!
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 05.07.02 09:20 
Hi user defined image
am einfachsten ist es mit shellexecute, aber sehr unschön, das sich die Mail nicht selbst abschickt.
ausblenden Quelltext
1:
2:
3:
4:
5:
6:
7:
ShellExecute(0, 
             'open',
             PChar('mailto:mail@delphi-forum.de?subject=Registrierantrag'
                  +'&body=Erstezeile%0AZweitzeile%0ADritttezeile'),
             '', 
             nil, 
             SW_Normal);


Ansonsten würde ich lieber die Indykomponente TidPOP3 nehmen. Aber dann muss man entsprechend die Benutzerdaten eingeben.

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 05.07.02 09:27 
und wie mache ich das das sich die mail selber abschickt,also das sich nicht wie in diesem beispiel,ein mailprogramm aufgeruft wird ?????

Jagg !!!!!!!1
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 05.07.02 09:36 
Das ist nicht so easy wie du denkst. Mit Shellexecute bekommst du es so gar nicht hin, außerdem weißt du ja gar nicht, welchen Mailclient der User nutzt. Wenn du clientsocket nehmen willst, wird es haarig, da nimm lieber fertige Mail-Komponenten. Entweder eine Indy-Komponente, oder du nutzt das Mapi-Interface von Outlook. Komponenten zu diesem Thema findest du hier.

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 05.07.02 09:49 
wenn ich clientsocket benutze wie gehte s dann ???
Kann es dann auch selber mail verschicken ???


Jagg !!!!!!!!!!!!!!1
Arakis
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 344



BeitragVerfasst: Fr 05.07.02 10:13 
Nimm mal dein Telnet und versuch mal per Hand ne Mail damit zu schreiben. Sollte in etwa so aussehen:
ausblenden volle Höhe 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:
telnet <mailserveradresse> 25
Send > HELO younamehere [ENTER]

Read > 250 HisComputerNameGo'sHere Hello YourCompName [192.168.0.3],
pleased to meet you[ENTER]

Send > MAIL FROM:<emailaddress>[ENTER]
Read > 250 <e-mailaddress>... Sender ok[ENTER]
Send > RCPT TO:<SendToEmailAddress>[ENTER]
Read > 250 <SendToEmailAddress>... Recipient ok[ENTER]
Send > DATA[ENTER]
Read > 354 Enter mail, end with "." on a line by itself[ENTER]
//Now come the headers
Send > From: "YourName" <YourEmailAddress>[ENTER]
Send > To: SendToEmailAddress[ENTER]
Send > Date: TheDate[ENTER]
Send > MIME-Version: MimeVersion[ENTER]
Send > Content-type: ContentType[ENTER]
Send > Content-transfer-encoding: ContentTransferEncoding[ENTER]
Send > Subject: Subject[ENTER]
Send > Priority: normal[ENTER]
Send > YourEmailGo'sHere[ENTER]
Send > You could add as much lines as you want[ENTER]
Send > But Remeber never use the . an one line only.[ENTER]
Send > because that means it is the end of you e-mail.[ENTER]
Send > Also never forget the enter on the end of a line. [ENTER]
Send > There are people who forgot and the got a weird [ENTER]
Send > message. [ENTER]
Send > The things that you could read are maybe different [ENTER]
Send > than the things that I read.
Send > ByeBye.
Send > .
Send > QUIT


Und das alles kannst du auch mit dem Clientsocket erledigen. Musst halt aber immer erst auf die Antwort warten.

Bis dann
user defined image

_________________
Mit dem Computer löst man Probleme, die man ohne ihn nicht hätte.
Entwickler von SpaceTrek: The New Empire - Siehe Hompage!
Jagg Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 635



BeitragVerfasst: Fr 05.07.02 10:27 
hey,was ist denn ein telnet ???
und ich verstehe überhapt nicht was du da geschriben hast,
das soll auch mit clientsocket gehen ???

schreib mir mal hin wie das aussehen soll !!!

Jagg