When you are preparing to send the email, after creating the account, you will have to add into your database a record to validate that account, which should include the ID for that account and an activation string (I would generate a 10 to 15 character random hex or alphanumeric string). This record should also have a boolean true or false whether it's been activated or a numeric (or Binary) 1 or 0. Set this to false before sending the email. Send this activation string and account ID in a link in the email.
For any links that you create, you're going to want a single page for them to go to, i.e. activateaccount.php
From inside that file, you can receive a $_GET parameter, maybe $_GET['activation'] and $_GET['account_id']. From this page, you will validate that the activation and account_id are both valid and that they match each other. If not, then the script should NOT attempt to fix the mismatch by writing to the database, as this could allow undesired attacks. If they are both valid and match, then the account may be activated.
Also as Pingbeat suggested, have a go at Swiftmailer. I have used it before in many projects and can confirm that it is extremely versatile, fast, very well documented and incredibly easy to use.
I hope this suggestion helps.