{
Shellexecute(Handle,'open','mailto:aaaa@bbb.com?subject&body=body
text&CC=aaaa&bcc=dddd&attach=FileName',nil,nil,SW_SHOW)
only works with outlook, not for outlook express,
but the method below can send attachment to outlook express
}
uses ComObj;
procedure SendMail(Subject, Body, RecvAddress : string; Attachs : array of string); var MM, MS : Variant;
i : integer; begin MS := CreateOleObject('MSMAPI.MAPISession'); try MM := CreateOleObject('MSMAPI.MAPIMessages'); try MS.DownLoadMail := False;
MS.NewSession := False;
MS.LogonUI := True;
MS.SignOn;
MM.SessionID := MS.SessionID;
for i := Low(Attachs) to High(Attachs) do
begin MM.AttachmentIndex := i;
MM.AttachmentPathName := Attachs[i]; end;
MM.Send(True);
MS.SignOff; finally VarClear(MS); end; finally VarClear(MM); end; end;