Hi,
And welcome to LQ!
I don't fully understand your request ... how are you using mkpasswd?
If you want to be able to e-Mail a temporary password to a user you could
do something like this ... (assuming that their account and e-Mail are identical).
Code:
username=one_user
newpwd=$(mkpasswd)
echo ${username}:${newpwd}|chpasswd
echo "Your new password is:'${newpwd}'"|mail -s pwd ${username}
Cheers,
Tink