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:
| unit umail;
interface
uses utypen,uconst,shellapi,comobj;
procedure mail(betreff:zeile; Mitteilung: string; Adresse:zeile; Dateianhang:string);
const umail_const = '1.03/120615';
implementation
procedure mail(betreff:zeile; Mitteilung: string; Adresse:zeile; Dateianhang:string); Var myoutlook,mailitem : variant; anhang : string; Begin myoutlook := createoleobject('Outlook.Application'); mailitem := myoutlook.createitem(0); mailitem.subject := betreff; if pos('@',adresse) = 0 then mailitem.to := 'Conny@diedrexlers.de' else mailitem.to := adresse; mailitem.body := mitteilung + #13 + #13 + 'Mailversion: ' + umail_const; if pos(';',dateianhang) > 0 then Begin repeat if pos(';',dateianhang) > 0 then Begin anhang := copy(dateianhang,1,pos(';',dateianhang) - 1); mailitem.Attachments.add(anhang); dateianhang := copy(dateianhang,pos(';',dateianhang) + 1,length(dateianhang)); end; until pos(';',dateianhang) = 0;
end; if dateianhang <> '' then mailitem.Attachments.add(dateianhang); mailitem.send; end;
end. |