Topic: email notifications

Blacknova Trader uses the built in mail function that is part of php. 

If you use gmail to send out email notifications this will not work as gmail needs a secure connection via SSL on port 465. 

So the question becomes, how does a new user sign up and get the welcome email with their password now ?

I have created a extra table that hold the new information and a trigger that would detect a new user.  There is a external program that monitors the new table, and then sends a welcome email.  Here are the steps.


1. Create a extra table in the bnt database. I called this one bnt_znotifications, here is the SQL statement that I used to create it.

      CREATE TABLE bnt_znotification (
         id int(11) NOT NULL AUTO_INCREMENT,
         ship_name char (20) NOT NULL,
         character_name char(20) NOT NULL,
         password char(60) NOT NULL,
         email char(60) NOT  NULL,
     sent bool,
         PRIMARY KEY (id)
     )

2  Next is the trigger.  When a new user signs up, the trigger will populate the bnt_znotificatoin table.
     
     USE BNT;
     DELIMITER $$
     CREATE TRIGGER before_ship_update
         AFTER INSERT on bnt_ships
         FOR EACH ROW
         BEGIN
                  INSERT INTO bnt_znotification (ship_name, character_name, password, email, sent)
                    VALUES(New.ship_name, NEW.character_name, NEW.password, NEW.email, FALSE);
         END$$
     DELIMITER ;


3.  External Program runs ever 30 seconds, checks bnt_znotifications table for entries.  If an entry is found it will use the information in the table . i.e. email address, ship name, character name, and send a welcome email to the new user.

The extrenal program is a program written in visual basic 6. 
     It uses CDO to send an email using the smtp for gmail on port 465, using SSL. 
     It uses the mysql ODBC connector to connect to the mysql database.


#3 is still a work in progress. The email part work, the mysql part works, both need to be combined into one program.