2007. március 18., vasárnap

Send an email from Delphi


Problem/Question/Abstract:

Send an email from Delphi

Answer:

It can be so easy to have your application pop up an email window.. assuming that a mail reader is installed (see below):

uses
  ShellAPI;

ShellExecute(0, 'open', 'mailto: peter@preview.org?subject=my subject',
  nil, nil, SW_SHOWNORMAL);

Netscape installation:
in the registry add this entry (use the correct path to Netscape.exe):

[HKEY_CLASSES_ROOT\mailto\shell\open\command]
@="\"C:\\Program Files\\Netscape\\Program\\Netscape.exe\" %1"

Nincsenek megjegyzések:

Megjegyzés küldése