Autor Beitrag
J.Borchert
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 150

WIN10
XE2 Professional
BeitragVerfasst: So 31.10.04 22:02 
Ich würde gern soetwas benutzen:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
      ShellExecute(Application.Handle, 'open',
           PChar('mailto:'+ Edit1.Text +'?'+
                 'subject='+ Edit2.Text +'&'+
                 'body='+memo1.Text +'&'+
                 'Attachment='+Edit3.Text) , nil, nil, sw_ShowNormal);

1.Problem:
Das mit dem Attachment funktioniert leider nicht, vielleicht kennt noch jemand einen Trick dazu ?

2.Problem:
Wenn ich memo1.Text übergebe sind dummerweise alle Zeilenumbrüche dahin.
Habe schon versucht als Umbruch #10#13 zu verwenden, aber nix klappt so richtig....

Bitte um Hilfe :oops:

mfG Jürgen

Moderiert von user profile iconChristian S.: Code- durch Delphi-Tags ersetzt.
Moderiert von user profile iconChristian S.: Topic aus VCL (Visual Component Library) verschoben am So 31.10.2004 um 23:26
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 31.10.04 23:04 
Für die Zeilenumbrüche musst du in dem Fall auch die URL-Encodierung nutzen: %0D%0A

Für das Attachment würd ich dir den Link Im Ordner SendTo "Senden an Mailempfänger" empfehlen. Vielleicht findest du dort was.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
J.Borchert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 150

WIN10
XE2 Professional
BeitragVerfasst: Mo 01.11.04 10:36 
Danke für die Tips:

Habe erstmal das Problem Umbrüche gelöst:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
function MemoToEmail(m:TMemo):string;
  var i:integer;
    begin for i:=0 to m.Lines.Count-1 do
            result:=result+m.Lines[i]+'%0D%0A';
    end;


Aber mit dem Attachment komme ich nicht weiter :cry:

mfG Jürgen
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Mo 01.11.04 10:46 
Tipp: Die Ersetzung kannst du auch mit Text := StringReplace(Memo1.Lines.Text, #13#10, '%0D%0A', [rtReplaceAll]);
Bin mir aber beim Präfix des letzten Parameters nicht ganz sicher.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mo 01.11.04 13:15 
Hallo du,

Anhänge über ShellExecute versenden geht nicht. Versuche es mal mit MAPI.

Gruß Jens.
J.Borchert Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 150

WIN10
XE2 Professional
BeitragVerfasst: Di 02.11.04 19:01 
Wie fange ich an mit MAPI ?

Habe die Procedure zum Erstellen des Textes (Body) geändert:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
function MemoToEmail(m:TMemo):string;
  var i:integer;
      sl:TStringList;
    begin sl:=TStringList.Create;
          for i:=0 to m.Lines.Count-1 do
            sl.Add(StringReplace(m.Lines[i],'%','%25',[rfReplaceAll]));
          for i:=0 to sl.Count-1 do
            result:=result+sl[i]+'%0D%0A'; //  #10#13
          sl.Free;
          StringReplace(result,'!','%21',[rfReplaceAll]);
          StringReplace(result,'#','%23',[rfReplaceAll]);
          StringReplace(result,'*','%2A',[rfReplaceAll]);
          StringReplace(result,'/','%2F',[rfReplaceAll]);
          StringReplace(result,'?','%3F',[rfReplaceAll]);
          StringReplace(result,'Ä','%C4',[rfReplaceAll]);
          StringReplace(result,'Ö','%D6',[rfReplaceAll]);
          StringReplace(result,'Ü','%DC',[rfReplaceAll]);
          StringReplace(result,'ß','%DF',[rfReplaceAll]);
          StringReplace(result,'ä','%E4',[rfReplaceAll]);
          StringReplace(result,'ö','%F6',[rfReplaceAll]);
          StringReplace(result,'ü','%FC',[rfReplaceAll]);
    end;


Über einen MAPI-Anschupser wäre ich dankbar.................

Jürgen
Aton
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 125

Windows XP
D7 Enterprise
BeitragVerfasst: Mi 03.11.04 08:50 
Hallo,

hier ist ein Beispiel:

www.techtricks.com/delphi/sendmail.php

Als Alternative kannst du auch die Indy-Komponenten benutzen. Das ist ein Mail-Client und dann kannst du die Emails aus dem eigenen Programm senden. Dann braucht nämlich kein MAPI-fähiges Emailprogramm installiert sein.

Gruß Jens.
Amiga-Fan
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 534



BeitragVerfasst: Di 16.11.04 20:25 
@J.Borchert

StringReplace liefert doch einen Wert zurück, oder nicht?! Dann mußt du doch
ausblenden Quelltext
1:
result:=StringReplace(result,'!','%21',[rfReplaceAll]);					


machen, denke ich.
syrious
Hält's aus hier
Beiträge: 10



BeitragVerfasst: So 15.05.05 19:29 
Gibt es ne Möglichkeit dass man nicht selber auf "Senden" klicken muss? (außer mousemove... :lol: ) um die Mail abzuschicken?