频道分类

Delphi ShellExecute 发送邮件

作者:admin 来源: 日期:2020/11/11 14:33:58 人气: 标签:

 

 uses
 shellapi;
 
 procedure TForm1.Button1Click(Sender: TObject);
 var
  em_subject, em_body, em_mail : string;
 
 begin
  em_subject := 'Test Message';
  em_body := 'Hello this is a test Message from Shell Execute Command to Open the 
 Default Mail Wndow'
 
  em_mail := 'mailto:jdhiraj@rediffmail.com?subject=' +
 em_subject + '&body=' + em_body ;
 
  ShellExecute(Handle,'open',
  PChar(em_mail), nil, nil, SW_SHOWNORMAL);
 end;