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 51 52
|
unit EnvoiConfirmationU;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
MAPI, SendMail;
type
TFormMAPI = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Déclarations privées }
public
{ Déclarations publiques }
end;
var
FormMAPI: TFormMAPI;
implementation
{$R *.DFM}
procedure TFormMAPI.FormCreate(Sender: TObject);
const BreakLine = #13+#10;
begin
with TMAPIMail.Create(Self) do
begin
Subject:='CONFIRMATION DE COMMANDE ';
if ParamCount>=1 then Subject:=Subject+ParamStr(1);
if ParamCount>=2 then Recipients.Append(ParamStr(2));
if ParamCount>=3 then Attachments.Add(ParamStr(3));
Body:='Chère cliente, cher client,'+BreakLine+BreakLine+
'Nous vous remercions pour cette commande dont vous trouverez ci-joint la confirmation.'+BreakLine+
'Merci de bien vouloir la vérifier et de nous informer, sous huitaine, de tout point non conforme.'+BreakLine+
BreakLine+'Bien cordialement.'+BreakLine+BreakLine+BreakLine;
Body:=Body+
'Dear customer,'+BreakLine+BreakLine+
'We thank you for this order. Please see it attached.'+BreakLine+
'Please check all the info and inform us if there is any mistake.'+BreakLine+BreakLine+
'Best regards.'+BreakLine+'²';
Send;
if LastError<>SUCCESS_SUCCESS
then MessageDlg('² MAPI Envoi non réussi'+#13+#10+'Erreur :'+MAPIErrorDescription(LastError), mtError, [mbOK], 0);
Free;
end;
Application.Terminate;
end;
end. |
Partager