Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

email password

Status
Not open for further replies.

jehanmylene

Technical User
Mar 24, 2003
1
US
I have a form that creates a new user into a mySQL database. What can I add to my script to email the password to the new user?
 
If you have access to SENDMAIL, you can add something like the following:

my $user_email = 'user@email.com';
my $dist_email = 'youremail@something.com';
my $mailprog = '/usr/sbin/sendmail';

print "Content-type: text/html\n\n";

open MAIL, "| $mailprog -t -i" or die "Couldn't open Mail Program: $!";

print MAIL "To: $user_email\n";
print MAIL "From: $dist_email\n";
print MAIL "Subject: Thank you for joining....\n\n";
print MAIL "Here's your password.......";

close MAIL or die "Couldn't close Mail Program: $!";


There's always a better way...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top