Mega Code Archive

 
Categories / Delphi / LAN Web TCP
 

Call the default email program to send an email

Title: call the default email program to send an email? uses ShellApi; procedure TForm1.Button1Click(Sender: TObject); var strEmail, strSubject, strBody, Param: string; begin strEmail := 'user@host.com'; strSubject := 'Your Subject'; strBody := 'Your Message Text'; Param := 'mailto:' + strEmail + '?subject=' + strSubject + '&Body=' + strBody; ShellExecute(Form1.Handle, 'open', PChar(Param), nil, nil, SW_SHOWNORMAL); end; { Note: Shellexecute doesn't accept Attachments. Use MAPI to send Attachments. Use %0D%0A for a line break Bemerkung: Shellexecute akzeptiert keine Attachment-Angaben. MAPI unterstützt Attachments. Setze ein %0D%0A ein, um einen Zeilenumruch im Body zu erzwingen }