I was attempting to send an email in a PHP script.
The problem was that I did not have the part of the script that sends the email within the {} which held the functions to execute when the registration form on my site was submitted.
Basicly, the script was trying to send the email, before the variable was set.
By putting the email function just bofore the final '}' in my PHP functions to be executed on submission of the registration form, I do not get that error, and it still inserts the information into the database and performs the other functions correctly.
It's a quick fix.
I hope that helps.