Setting the default value for a text field as a variable in Form API
You don't need to use user_load($user-&gt;uid);. You already have a complete object inside global $user; variable. And don't forget PHP is not a natural languages. You can't just put whitespaces where you want them. In method call or property access, there should be no spaces around -&gt;, it should be right next to object, and property should be right after arrow.

This line is sufficient for me:

'#default_value' =&gt; $user-&gt;mail,