Skip to content

Commit

Permalink
Merge pull request #13 from mateusvicente100/master
Browse files Browse the repository at this point in the history
Adicionando MessageId
  • Loading branch information
juliosenha authored Jan 4, 2024
2 parents 9ecc391 + ed2415c commit 582c930
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/Mail4Delphi.Intf.pas
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ interface
function AddReplyTo(const AMail: string; const AName: string = ''): IMail;
function AddCC(const AMail: string; const AName: string = ''): IMail;
function AddBCC(const AMail: string; const AName: string = ''): IMail;
function MessageId(const AMessageId: string): IMail;
function AddBody(const ABody: string): IMail;
function ClearBody: IMail;
function ClearAttachments: IMail;
Expand Down
9 changes: 8 additions & 1 deletion src/Mail4Delphi.pas
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ TMail = class(TInterfacedObject, IMail)
function AddCC(const AMail: string; const AName: string = ''): IMail;
function AddBCC(const AMail: string; const AName: string = ''): IMail;
function AddBody(const ABody: string): IMail;
function MessageId(const AMessageId: string): IMail;
function ClearBody: IMail;
function ClearAttachments: IMail;
function Host(const AHost: string): IMail;
Expand Down Expand Up @@ -137,6 +138,12 @@ function TMail.Host(const AHost: string): IMail;
Result := Self;
end;

function TMail.MessageId(const AMessageId: string): IMail;
begin
FIdMessage.MsgId := AMessageId;
Result := Self;
end;

function TMail.MessageDefault: IMail;
begin
FIdMessage.Encoding := meMIME;
Expand Down Expand Up @@ -348,7 +355,7 @@ function TMail.SendMail: Boolean;
begin
if not SetUpEmail then
raise Exception.Create('Incomplete data!');
LImplicitConnection := False;
LImplicitConnection := False;
if not FIdSMTP.Connected then
LImplicitConnection := Self.Connect;
try
Expand Down

0 comments on commit 582c930

Please sign in to comment.