Archive

Archive for the ‘Internet / LAN’ Category

How to Send E-mail With the Default E-mail Client

October 19th, 2007 m3Rlin No comments

You may want to allow users to send you back feedback. You can either send it directly to your site via sockets or send the user to your website. What if you don’t have a website? No feedback? Yeah, right. Just have them send it to you by e-mail.

You can not send spaces in URLs, you have to convert them first. Example: if the subject were to be ‘Bug Report!’ then you should put %20 instead of the space character – ‘Bug%20Report!’. %20 is the ASCII value for space.

In this example MemoBugText is the memo in which the user describes the bug, ‘bugreports@youremail.com’ is your e-mail address and ‘Bug Report’ is the subject of that e-mail.

uses
  ShellAPI, Windows;

// For more information on ShellExecute() check out our tip
// "How to run programs and execute documents, mailto links and URLs" in the Windows category
ShellExecute(0, 'open', PChar('mailto:bugreports@youremail.com?subject=Bug%20Report&Body=' + MemoBugText.Text), nil, nil, SW_SHOWNORMAL);

How to Start and Control Netscape Navigator

December 15th, 1999 m3Rlin No comments

If you want to include a link to a web page and you want Netscape Navigator to do it you may want to look at this code. This should work with Netscape Navigator. This function has not yet been tested with Netscape Navigator 6.0.

uses
  DDEMan, Registry;
...
procedure StartNetscape(const sURL: string);
const
  sNETSCAPE = 'Netscape';
var
  sLocation: string;
begin
  with TRegistry.Create do
    try
      RootKey := HKEY_CLASSES_ROOT;
      if OpenKeyReadOnly(sNETSCAPE + 'MarkupprotocolStdFileEditingserver') then begin
        sLocation := ReadString('');
        CloseKey;
      end;
    finally
      Free;
    end;

  with TDDEClientConv.Create(nil) do
    try
      { The location of Netscape Navigator }
      ServiceApplication := sLocation;
      { Activate Netscape Navigator }
      SetLink(sNETSCAPE, 'WWW_Activate');
      RequestData('0xFFFFFFFF');
      { Go to the specified URL }
      SetLink(sNETSCAPE, 'WWW_OpenURL');
      RequestData(sURL + ',,0xFFFFFFFF,0x3,,,');
      CloseLink;
    finally
      Free;
    end;
end;

Example: StartNetscape(‘http://www.m3Rlin.org‘);