Configuring the Database accounts:
In order to create/modify/delete the database accounts, follow the steps given below:
Stop the JCourier by pressing the "Stop" button on the tool bar. Press the "Database Account" icon on the tool bar to view a list of existing database accounts or
choose "Action | Database account" from the menu bar.
When you do either of the above said action, the "Database Accounts" dialog box will be opened as shown below.
Fig - 1.1
In the above figure, the list box at the centre of the window, will show you all the configured database accounts. Press the "New" button to create a new Database Account. To remove an existing Database Account, select one from the list and press the "Remove" button. To view/edit the properties of an exsting account, select the account you want to view/edit and press the "Properties" button. Press the "Close" button to close the window.
Creating a New Database Account:
Press the "New" button in the above dialog box to create a new Database account. A new Dialog box will be opened as shown below.
Fig - 1.2
Specify a friendly name for this account. If you are planning to use this account for sending news letters, you may give the name as "NewsLetter". As in the case of POP-3 Accounts, in this case also JCourier will create new file(s) for each new Database account. So make sure that your operating system allows to create a file with the name you have specified here.
In this field, specify the E-Mail address, that JCourier has to use while sending the News Letters. In this case, it could be "firstname.lastname@example.org". It is not necessary that this E-Mail address should be existing.
When you are done with the above, click on the "Database Info." tab on the top of the window and you will see the following screen.
Fig - 1.3
Here you specify the Database driver that JCourier has to use in order to connect to your Database. If you are using windows and have ODBC installed, then the default driver "sun.jdbc.odbc.JdbcOdbcDriver" (JDBC-ODBC bridge) will work with all the popular RDBMS. But, if you are using a diffrent OS, you may have to have a JDBC driver which allows JCourier to connect to your database. If you do not know much about this, contact yout Database administrator.
Data Source Name:
Here you will specify the Data Source Name along with its protocol and subprotocol, that actually points to your database. If you are using windows and have installed ODBC drivers, then the data source name will be "jdbc: odbc:yourdatasource". Here "jdbc" is the protocol and "odbc" is the sub protocol. If you are unable to fill this field, please contact your system/database administrator.
Specify the user name that is required to connect to the database. JCourier will try to login to your database with this user name.
Specify the password corresponding to the user name you have specified. Both user name and password will be used to login into your Database server and gain access to the data.
When you are done with the above, click on the "Tables/Columns" tab on the top of the window. By doing so, you will see the following screen.
Fig - 1.4
Click on the "Show" button to view all the tables that are there in the database you have specified in the previous step. When you do so, JCourier will try to connect to the database and will show you all the tables in that database. If JCourier can not connect to the database, it will display an appropriate error message. Selecting a table from the "Select a Table" drop-down list box will populate the "Select a Column" drop-down list box with the column names in the selected table.
Consider the following example which will show you how to select the table name and column name.
Suppose, you have a Table called "subscribers" in your database. The "subscribers" table has four columns namely "NAME", "EMAIL", "TITLE" and "TEL". You store details of the persons those who have subscribed for your weekly news letter. Inorder to automate your news letter mailing using JCourier, select the table name "subscribers" in the first drop-down list box and, the column name "EMAIL" in the second. The basic idea is the column name you select must contain an E-Mail address in it. This is same as firing a query to your database "SELECT EMAIL FROM subscribers", which will yield a result set that will contain all the E-Mail addresses of the subscribers.
Alternately, you can write your own query by checking the check box "I want to write my own query". This is required when you want to get the E-Mail addresses conditionally, or you have to query on multiple tables. One E.g. could be, if you want to send a product upgrade/patch to your clients who have 1.0 version, then your query could be "SELECT EMAIL FROM CLIENTS WHERE PROD_VERSION='1.0'".
Make sure that your query yields a result set with only one column and that column contains E-Mail addresses. Even if your query yield a result set with more than one column, JCourier will pick the first column from the result set and treat the data in that column as an E-Mail address.
When you are done with the above, click on the "Message Details" tab on the top of the window. By doing so, the following screen will appear.
Figure - 1.5
Here, you will enter the actual E-Mail related data viz. subject for the E-Mail and the file name that contains the message. Again, the file can be a HTML/TEXT file.
Thats it. Press "OK" to save the settings. The above window will disappear and you will see the following screen.
Figure - 1.6
If any error occurs while creating the new account an appropriate error message will be displayed. Now the new account "NewsLetter" is created. When ever you want to send Newsletters to your subscribers that are there in the database, select the account from the list and press the "Send Mails" button. When you do this, JCourier will fetch the data from the database by executing the query corresponding to this account and saves them in the .obx (OUTBOX) file. This process may take some time depending on the number of records in the table.
After doing so, click on "Close" button to close the dialog box and start JCourier. As you can see from the status window, JCourier will start sending mails to all the E-Mail addresses that are there in the database.