+ Start a Discussion
sneha vsneha v 

forgot password mail to gmail using apex

Hi ,

 

I want to write a program for forgot password button .

 

it has to work in the following way -> 

 

once i click the button , the user has to give his email id 

if the email id is present in my database i have a shoot his password to his email id ... 

 

 

please help ... 

Best Answer chosen by Admin (Salesforce Developers) 
MJ Kahn / OpFocusMJ Kahn / OpFocus

See page 511 of http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

 

That page provides a detailed example of how to use Apex to send an email message.

 

 

 

All Answers

MJ Kahn / OpFocusMJ Kahn / OpFocus

If it's a regular Salesforce User password that you want to send, you're pretty much out of luck - Salesforce doesn't store User passwords anyplace where they can be retrieved in cleartext. 

 

If it's some other value that's stored in a Salesforce object, then it's possible to send an email to someone once you have their email address. The Apex Language Reference has examples of how to construct an email message in Apex. And the Visualforce Developer's Guide can help you put together a Visualforce page that gets the user's email address. But in order to get more detailed help from people on this board, you'll probably need to give lots more detail about what you're trying to accomplish and the approach(es) you've already tried taking.

sneha vsneha v

Hi ,

 

please be specific ... 

i have gone through the reference books ...

i had difficulty in finding it ....

if possible please provide me with the link of the page ..... 

 

Thanks a lot,

Sneha 

MJ Kahn / OpFocusMJ Kahn / OpFocus

See page 511 of http://www.salesforce.com/us/developer/docs/apexcode/salesforce_apex_language_reference.pdf

 

That page provides a detailed example of how to use Apex to send an email message.

 

 

 

This was selected as the best answer
sneha vsneha v

Thanks ,

It worked !!!