Hi Martin,
They way that I achieve this is to have a PHP function that randomly generates a string. This then populates a hidden field on the signup page, which is inserted into the database.
Then when the database entry for the account has been inserted you can fire an email to the user containing the randomly generated string.
Hope this helps
Cheers
Ian