You need to sign in to do that
Don't have an account?
rajahm
Wants to retrieve logged-in user's e-mail address
Hello,
{!$User.Email}
I want to retrieve logged-in user's e-mail address. It is very easy to get in Visual Force Page using { !$User.Email}. How can we get this information into APEX code. I am sure that I am missing something here.
Any assistance is appreciated.
Thanks
Raja
Best Answer chosen by Admin (Salesforce Developers)
Ritesh Aswaney
User u = [Select Id, Name, Email from User where Id = :UserInfo.getUserId()];
System.debug(u.Email);