Autor Beitrag
fishhed
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Di 09.01.07 18:58 
Hallo zusammen,

gibt es einen Delphi-Befehl mit dem man sein E-Mail-Programm öffnen kann?

Ich stelle mir das ungefähr so vor:

- Ich schreibe eine Mailadresse in ein Textfeld und drücke auf einen Button 'OK'.
- Das Standard-Mail-Programm öffnet sich und darin das Fenster für eine neue Mail.
- In die Mail ist als Empfänger die Mailadresse und ein vorher definierter Betreff und Mail-Text eingetragen.
- Ich drücke dann nur noch auf senden und los geht es!

Gibt es sowas? Wenn man im Browser auf mailto:mail@xy.de klicke geht es ja.

Vielen Dank für eure Hilfe!

Der Marcel
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 09.01.07 19:04 
Hi Marcel,
mit dem Befehl Shellexecute kannst du Anwendungen aufrufen.
Speziell zu deinem Problem:
ausblenden Delphi-Quelltext
1:
2:
  ShellExecute(Application.Handle, 'open',
    PChar('mailto:emailadresse@web.de?subject=Betreff&body=VordefinierterText'), nilnil, sw_ShowNormal);

Vorher musst du allerdings noch die Unit ShellApi in dein Projekt miteinbinden.

grüße Marc
Gausi
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 8548
Erhaltene Danke: 477

Windows 7, Windows 10
D7 PE, Delphi XE3 Prof, Delphi 10.3 CE
BeitragVerfasst: Di 09.01.07 19:06 
ausblenden Delphi-Quelltext
1:
ShellExecute(Handle, 'open''mailto:mail@xy.de'nilnil, SW_SHOWNORMAL);					


Ob und wenn ja wie man einfach nen Betreff und Text vorgeben kann, weiß ich nicht.

Edit: Hab ich wirklich 2 Minuten fürs Tippen gebraucht...:roll:

_________________
We are, we were and will not be.
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Di 09.01.07 19:10 
Cool, genau so habe ich mir das vorgestellt!

Weisst du auch wie ich Zeilenumbrüche in die E-Mail bekomme?
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: Di 09.01.07 19:12 
Ja, mit #10#13.
Bsp: text := 'a'+#10#13+'b';
#10 repräsentiert das Zeilenende, #13 Enter/neue zeile.
oder so in der Art. :)
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Di 09.01.07 19:26 
Hmmm, mit +#13+#10 hatte ich es auch schon versucht. Das klappt aber leider nicht. Die Mail sollte im Textformat sein.
.50AE
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 100



BeitragVerfasst: Di 09.01.07 19:29 
Hoi,

versuchs mal mit ...+sLineBreak+...

MfG
50ae
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Di 09.01.07 19:39 
user profile icon.50AE hat folgendes geschrieben:
Hoi,

versuchs mal mit ...+sLineBreak+...



Das funktioniert leider auch nicht. Ich bekomme keine Zeilenumbrüche.
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: Di 09.01.07 19:48 
Du musst die entsprechende URL-Enkodierung verwenden:

ausblenden Delphi-Quelltext
1:
2:
ShellExecute(Application.Handle, 'open',
    PChar('mailto:emailadresse@web.de?subject=Betreff&body=Vordefinierter%0D%0AText'), nilnil, sw_ShowNormal);

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
fishhed Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 77


Delphi 7
BeitragVerfasst: Di 09.01.07 19:53 
Allerbesten Dank Christian! Das war die richtige Lösung!!!!