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

Make an audio file the entire MIME body

See more Email Object Examples

Use a single audio/wav part when an integration expects the payload itself to be audio. A conventional email addressed to a person can instead carry a text body and a file attachment. Supply a local recording named recording.wav.

Chilkat Delphi ActiveX Downloads

Delphi ActiveX
var
success: Integer;
mime: TChilkatMime;
mimeBytes: TChilkatBinData;
email: TChilkatEmail;

begin
success := 0;

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

mime := TChilkatMime.Create(Self);
success := mime.SetBodyFromFile('recording.wav');
if (success <> 1) then
  begin
    Memo1.Lines.Add(mime.LastErrorText);
    Exit;
  end;
mime.ContentType := 'audio/wav';
mime.Disposition := '';
mime.Filename := '';
mimeBytes := TChilkatBinData.Create(Self);
success := mime.GetMimeBd(mimeBytes.ControlInterface);
if (success <> 1) then
  begin
    Memo1.Lines.Add(mime.LastErrorText);
    Exit;
  end;
email := TChilkatEmail.Create(Self);
success := email.SetFromMimeBd(mimeBytes.ControlInterface);
if (success <> 1) then
  begin
    Memo1.Lines.Add(email.LastErrorText);
    Exit;
  end;
email.From := 'Workshop team <events@example.com>';
success := email.AddTo('Audio archive','audio@example.net');
if (success <> 1) then
  begin
    Memo1.Lines.Add(email.LastErrorText);
    Exit;
  end;
email.Subject := 'Workshop recording';

success := email.SaveEml('audio.eml');
if (success <> 1) then
  begin
    Memo1.Lines.Add(email.LastErrorText);
    Exit;
  end;
Memo1.Lines.Add('Saved audio.eml.');