Sample code for 30+ languages & platforms
Delphi DLL Requires Chilkat v11.0.0+

Set the display priority of a message

See more Email Object Examples

Set X-Priority to 1 (high), 3 (normal), or 5 (low). A mail reader can use it as a display hint. SMTP delivery order is controlled by the mail system.

Chilkat Delphi DLL Downloads

Delphi DLL
var
success: Boolean;
email: HCkEmail;

begin
success := False;

//  Assumes Chilkat is unlocked. See Global Unlock Sample.

email := CkEmail_Create();
CkEmail_putFrom(email,'Workshop team <events@example.com>');
success := CkEmail_AddTo(email,'Alex Rivera','alex@example.net');
if (success <> True) then
  begin
    Memo1.Lines.Add(CkEmail__lastErrorText(email));
    Exit;
  end;
CkEmail_putSubject(email,'Workshop venue change');
CkEmail_putBody(email,'Please use the north entrance.');
CkEmail_AddHeaderField(email,'X-Priority','1 (High)');
Memo1.Lines.Add('Priority: ' + CkEmail__getHeaderField(email,'X-Priority'));

success := CkEmail_SaveEml(email,'venue-change.eml');
if (success <> True) then
  begin
    Memo1.Lines.Add(CkEmail__lastErrorText(email));
    Exit;
  end;
Memo1.Lines.Add('Saved venue-change.eml.');

CkEmail_Dispose(email);