Wednesday, March 2, 2011

How to change Netscape preferences from your program (and access multiple email accounts)

If you've been wondering how to change Navigator 3.x's preferences (or settings) from your program, take a look at the following function:

procedure SetNetscapeMailPreferences(
    : string );
  r : TRegIniFile;

  procedure Save( a, b, c : string );
    r.WriteString( a, b, c + #0 );

  r := TRegIniFile.Create(
       + 'NetscapeNetscape Navigator'

  Save( 'Mail', 'POP Name',
    sMailboxName );

  Save( 'Services', 'POP_Server',
    sPOPServer );

  Save( 'Services', 'SMTP_Server',
    sSMTPServer );

  Save( 'User', 'User_Addr',
    sFromAddress );

  Save( 'User', 'User_Name',
    sUserName );

  Save( 'User', 'Reply_To',
    sReplyToAddress );

  Save( 'User', 'User_Organization',
    sOrganization );

  Save( 'User', 'Sig_File',
    sSignatureFile );

Listing #1 : Delphi code. Download nsmail (0.46 KB).
As you can see, Netscape's using the following registry key to store its user settings:
      Netscape Navigator
Listing #2 : TEXT code. Download reginfo (0.19 KB).
To get a list of other settings you can change, simply run "Registry Editor" ("RegEdit.exe") and select the above registry key.
Our example function "SetNetscapeMailPreferences()" will let you change your Netscape's mail preferences, which means you can utilize it to write a program that would let users access multiple email accounts using a single installation of Navigator 3.x. Here's a sample call:
  'Bob B Bob',
  'Bob Inc.',
Listing #3 : Delphi code. Download chngmail (0.22 KB)

Twitter Delicious Facebook Digg Stumbleupon Favorites More

Design by Kang Iwan K-sev | Thank's for your visit To My Site - Ridwan Mulyana | Cibeureum