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
|
with Idmessage1 do
begin
From.Address := 'monAdresse@MonDomaine.fr';
From.Name := 'Mon nom';
Recipients.EMailAddresses := StrDestinataire;
if trim(StrCCopy) <> '' Then
if BoolDestuniquement Then
Recipients.EMailAddresses := StrMyDestinataire+','+StrCCopy
else
CCList.EMailAddresses := StrCCopy
end
if BoolHightPriority Then
Idmessage1.Priority := mpHighest
else
Idmessage1.Priority := mpNormal;
Idmessage1.Subject := 'Mon Suject';
corps := TStringList.Create;
corps.Add(#13+#10+' ');
corps.Add('Veuillez trouver ci-joint ');
corps.Add('les documents journaliers vous concernant.');
IdMessage1.Body.Text := corps.Text;
corps.free;
TIdAttachmentFile.Create(IdMessage1.MessageParts,Nomfichier);
IdSMTP1.Connect; // Connexion
try
if (IdSMTP1.connected) then
begin
Try
IdSMTP1.Send(IdMessage1); // Envoi du message
IdSMTP1.Disconnect; // Déconnexion
DelayMs(5000);
except
onMessage(Format('Erreur envois : %s ',[StrMonMessage]));
end;
end;
except
end;
IdMessage1.Clear; |
Partager