I am working on a Drupal site where, i want to send an email to the user providing him with the password. Is it possible.....? I had attached the from image, On submission i want to send a password to the user


Even better, no custom coding: check out the RPT module.

From the description:

This small module provides token [user:password] during user registration. Site administrator allowed to customize the text of the e-mail that is sent to the user after registration.


Dig into these modules and you'll find something worth (quotes included are from their project pages):

  • Subscriptions:

    ...enables users to subscribe to be notified of changes to nodes or taxonomies, such as new comments in specific forums, or additions to some category of blog. Once enabled, all nodes will have an additional link that allows the user to change their subscriptions. Users have tab on their user screen to manage their own subscriptions. Users can also set an auto-subscribe function which notifies the user if anyone comments on posts they have made. Admins can turn this on by default.

  • Notifications:

    ... This is a complete Subscriptions/Notifications Framework aiming at extendability and scalability. It allows any number of plug-ins defining new event types or subscription types or a different user interface.


i dnt have exact idea about how to solve the issue just seen this text

"Drupal 7 Core itself, doesn't allow to send Mails with the generated password for the User. As @webchick told in the specific issue: http://drupal.org/node/660302#comment-2592510 it would be OK to have a contrib module, to provide this again.

So in the user.module, the $account->password is still set, but no token for it is generated.

I thought about a single module, for this functionality, but I think inside of loggintobogan it is a lot better.

Attached a patch, which adds the token, so that it can be used inside of the mail with "[user:password]"

on the link http://drupal.org/node/1165126 hope this would be helpful


The Registration Password Token module provides a token [user:password] during user registration. Since the site administrator allowed to customize the text of the e-mail that is sent to the user after registration, you can insert this token in the welcome email.

Caveat: Sending passwords with unencrypted email is a security hazard. This is why Drupal does not provide this function out of the box (as noted by senior core developer webchick: http://drupal.org/node/660302#comment-2592510).


You cannot get the user's password from what Drupal saves in the database. Drupal doesn't encrypt the password and saves it in the database, but it saves in database the hash of the password, which is the value returned from a one-way function; this means that is not possible to calculate the value that originated the hash. That is the reason why hashes are saved instead of the passwords: If somebody access the database used by a Drupal site, it is not possible to retrieve the passwords, and access that site as one of the users registered in that site.

but to invite all the user through mail i thnk you can implment it through a custom module by:

  1. Implement hook_cron, this would builds an array containing all emails that match the criteria of your choice.

Loop through the array and send the emails via drupal_mail.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy