How to send password in email body function lawyer_register_menu() {
  $items['lawyer_register'] = array(
    'title' =&gt; 'Lawyer Registration',
    'page callback' =&gt; 'drupal_get_form',
    'page arguments' =&gt; array(
      'lawyer_register_form'
    ),
    'access callback' =&gt; TRUE
  );

  $items['lawyer_register-autocomplete-engine'] = array(
    'page callback' =&gt; 'lawyer_register_autocomplete',
    'type' =&gt; MENU_CALLBACK,
    'access callback' =&gt; TRUE
  );

  return $items;
}
function lawyer_register_form($form, &amp;$form_submit) {
  $form         = array();
  $form['name'] = array(
    '#title' =&gt; 'Username',
    '#description' =&gt; 'choose a username',
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE
  );

  $form['mail'] = array(
    '#title' =&gt; 'email',
    '#description' =&gt; 'enter a valid email address',
    '#type' =&gt; 'textfield',
    '#required' =&gt; TRUE
  );

  $form['fname'] = array(
    '#title' =&gt; t('Full Name'),
    '#type' =&gt; 'textfield',
    '#size' =&gt; 20,
    '#maxlength' =&gt; 20
  );

  $form['phone_no'] = array(
    '#title' =&gt; t('phone_no'),
    '#type' =&gt; 'textfield',
    '#description' =&gt; t(''),
    '#size' =&gt; 20,
    '#maxlength' =&gt; 20
  );

  $form['street_address'] = array(
    '#title' =&gt; t('Street Address'),
    '#type' =&gt; 'textfield',
    '#size' =&gt; 50,
    '#maxlength' =&gt; 100
  );



  $form['county'] = array(
    '#title' =&gt; t('County'),
    '#type' =&gt; 'textfield',
    '#size' =&gt; 20,
    '#maxlength' =&gt; 20
  );

  $form['send_message'] = array(
    '#type' =&gt; 'checkbox',
    '#title' =&gt; t('Notify user of new account via email.'),
    '#description' =&gt; 'If left unchecked, a message will not be sent.',
    '#default_value' =&gt; 1
  );

  $form['submit'] = array(
    '#value' =&gt; 'Submit',
    '#type' =&gt; 'submit'
  );
  return $form;
}




function lawyer_register_form_submit($form, &amp;$form_submit) {
  $edit    = array(
    'name' =&gt; $form_submit['values']['name'],
    'pass' =&gt; user_password(),
    'mail' =&gt; $form_submit['values']['mail'],
    'init' =&gt; $form_submit['values']['mail'],
    'status' =&gt; 1,
    'access' =&gt; REQUEST_TIME,
    'fname' =&gt; array(
      LANGUAGE_NONE =&gt; array(
        array(
          'value' =&gt; $form_submit['values']['fname']
        )
      )
    ),
    'street_address' =&gt; array(
      LANGUAGE_NONE =&gt; array(
        array(
          'value' =&gt; $form_submit['values']['street_address']
        )
      )
    ),
    'phone_no' =&gt; array(
      LANGUAGE_NONE =&gt; array(
        array(
          'value' =&gt; $form_submit['values']['phone_no']
        )
      )
    ),
    'county' =&gt; array(
      LANGUAGE_NONE =&gt; array(
        array(
          'value' =&gt; $form_submit['values']['county']
        )
      )
    )
  );
  $to      = $form_submit['values']['mail'];
  $subject = 'New account created';
  $headers = "From: something@somewhere.org\nContent-type: text/html";
  $body    = 'A new user account has been created for you at &lt;a  href="http://something.org/"&gt;Something.org&lt;/a&gt;.&lt;br /&gt; Your login details are as follows:&lt;br /&gt;Username: &lt;b&gt;' . $form_submit['values']['name'] . '&lt;/b&gt;&lt;br /&gt; Password: &lt;b&gt;\'???????\'&lt;/b&gt; &lt;br /&gt;&lt;br /&gt; Please login to &lt;a  href="http://us.lawandmoney.info"&gt;Lawandmoney.org&lt;/a&gt; and change your password.&lt;br /&gt;';
  if ($form_submit['values']['send_message'] == 1) {
    mail($to, $subject, $body, $headers);
  }
  user_save(drupal_anonymous_user(), $edit);
  drupal_set_message("Successfully Register. Please check your Email for login    details.");

}


here I'm creating customized login registration page working properly. Now I want to send password to user via email so what i can write in message body like for username I write Username: '.$form_submit['values']['name'].' So what can I write for password?
Store user_password() in a variable. Change your code to this

    function lawyer_register_form_submit($form, &amp;$form_submit)
    {
     $new_password = user_password();
     $edit = array(
      'name' =&gt; $form_submit['values']['name'],
      'pass' =&gt; $new_password,
      'mail' =&gt; $form_submit['values']['mail'],
      'init' =&gt; $form_submit['values']['mail'],
      'status' =&gt; 1,
      'access' =&gt; REQUEST_TIME,
      'fname' =&gt; array(LANGUAGE_NONE =&gt; array(array('value' =&gt; $form_submit['values']   ['fname']))),
      'street_address' =&gt; array(LANGUAGE_NONE =&gt; array(array('value' =&gt;  $form_submit['values']['street_address']))),
      'phone_no' =&gt; array(LANGUAGE_NONE =&gt; array(array('value' =&gt; $form_submit['values'] ['phone_no']))),
      'county' =&gt; array(LANGUAGE_NONE =&gt; array(array('value' =&gt; $form_submit['values'] ['county']))),
      );
      $to = $form_submit['values']['mail'];
      $subject = 'New account created';
      $headers = "From: something@somewhere.org\nContent-type: text/html";
      $body = 'A new user account has been created for you at &lt;a  href="http://something.org/"&gt;Something.org&lt;/a&gt;.&lt;br /&gt; Your login details are as follows:&lt;br /&gt;Username: &lt;b&gt;'.$form_submit['values']['name'].'&lt;/b&gt;&lt;br /&gt; Password: &lt;b&gt;'$new_password'&lt;/b&gt; &lt;br /&gt;&lt;br /&gt; Please login to &lt;a  href="http://us.lawandmoney.info"&gt;Lawandmoney.org&lt;/a&gt; and change your password.&lt;br /&gt;';
       if($form_submit['values']['send_message'] == 1){
         mail($to,$subject,$body,$headers);
         } 
       user_save(drupal_anonymous_user(), $edit);
       drupal_set_message("Successfully Register. Please check your Email for login    deatils.");

     }