Setting Up a SQLMail Client

To enable SQLMail functionality for a server, you will:

  1. Set up the server computer as a Microsoft Windows NT Mail client.
  2. Set up SQL Server as a SQLMail client.

The procedures that follow describe how to accomplish these tasks.

Note As a prerequisite to setting up a SQLMail client, a Mail post office must already be available. If one is not, see Setting Up a Mail Post Office, later in this chapter.

    To set up the server computer as a Microsoft Windows NT Mail client
  1. From the Main program group, double-click the Mail icon.

    The Welcome to Mail dialog box appears.

  2. Choose the option Connect To An Existing Postoffice, and then choose OK.

    The Connect to Postoffice dialog box appears.

  3. Enter the network path of the post office, and then choose OK.

    For example:

    \\airedale\wgpo
    

    A dialog box appears, asking whether or not you have an account on the post office.

  4. Choose Yes or No.

  5. Define a mail login account. At a minimum, enter a name, mailbox, and password.
    Name
    Is the full name of the mail user.

    Normally, this would be the full name of a user of this computer. For example:

    John Q. Public
    

    However, in this case, it is recommended that you consider creating a mail account especially for SQL Server. For example, if the local server is named TERRIER, you might enter:

    SQL Server Terrier
    
    Mailbox
    Is a mail address that will be used to log in to the post office.

    Normally, this would be a variation of the user's full name. For example, to represent "John Q. Public" you might enter:

    JohnQP
    

    Or for a mail login that will be used by the local SQL Server, you might enter:

    terrier
    
    Password
    Is a password for the mail login. For example:
    casey86
    
  6. Choose the OK button.

    The server is configured as a Mail client, the mail login account is created, and the Mail window appears.

  7. Verify that Mail is set up properly by sending an ordinary mail message to yourself. To send a message, choose the Compose button and complete the dialog box that appears.

    For information about sending and receiving messages, see the online Help for Mail.

  8. From the Mail menu, choose the Options menu and set the Mail options to appropriate values for use by SQL Server. In particular:

    For information about setting options, see the online Help for Mail.

Once the server is set up as a Microsoft Windows NT Mail client, you can set up SQLMail by using SQL Setup.

    To set up SQLMail
  1. Start the Mail client using the same Mail login account SQLMail will use to log on to Windows NT mail.

    You will specify the name and password of this Mail login account in step 7 of this procedure.

  2. From the Microsoft SQL Server 6.0 program group, double-click the SQL Setup icon.
  3. Follow the on-screen instructions until the Microsoft SQL Server 6.0 Options dialog box appears.

  4. Choose Set Server Options, and then choose Continue.

    The Select Server Options dialog box appears.

  5. To start a SQLMail session every time SQL Server starts, select Auto Start Mail Client.
  6. To set the SQLMail login options, choose the Mail Login button.

    The Mail Login dialog box appears.

  7. To specify a mail login account SQLMail will use to log in to Windows NT Mail, in the Mail Login Name box, type a valid Mail login name; in the Mail Password box type the password for that Mail login name; and in the Confirm Password box type the password again.

    If you have configured SQL Server to start SQLMail sessions automatically, you must supply a mail login name and password. If you will be starting mail sessions manually (by using xp_startmail), you can optionally supply your login name and password in this dialog box so that you do not have to type it at the command line. (Note that SQLMail will "piggyback" an existing client session of Mail, if one is running.)

    Note If at any time the Windows NT Mail password is changed, you will need to change the password here as well.

  8. If you are setting up SQLMail on this server for the first time, select the option Copy SQLMail Configuration from Current User Account.

    This copies the post office location and mail options of the user you set up the Windows NT Mail client for previously. The settings are copied to the Default User.

    Even if you don't use the Mail Login dialog box to save a Mail username and password, you must select this option when setting up SQLMail for the first time. Thereafter, the check box does not need to be selected unless you have changed your Mail client configuration information.

  9. Choose Continue.

    The Select Server Options dialog box returns.

  10. Choose Change Options.

    The new settings are processed.

  11. Choose Exit.

After SQLMail is installed, by default the SQL Executive service will automatically attempt to start the SQLMail session every time SQL Executive starts. This behavior can be controlled through a Registry value.

HKEY_LOCAL_MACHINE
    \SOFTWARE
        \Microsoft
            \MSSQLServer
                \SQLExecutive

Name: MailAutoStart
Type: REG_DWORD
Data:

If the value is set to 1, SQLMail auto-starts when SQL Executive starts. If the value is set to 0 or the Registry key does not exist, SQLMail does not start when SQL Executive starts. The default is 1.