I am trying to create a 'resend password' function as my members get a little confused sometimes (just as I am now!)...ah the irony!
In any case, the below code gets me to my output html template, however; I also want it to send details to the member via e-mail.
The below code gives me an e-mail and information in the subject line... but I don't know how to get information from let's say a .txt template with the message I want to say. any advice?
Here's the part that actually work's: go to www.yourstocktips.com.au/forgotpass.htm and type in "Nala" as the user name (dummy account).
Thanks!
OzNewbie
Here's the code:
Expand|Select|Wrap|Line Numbers
- ###############################
- # Send password
- ###############################
- sub pm_send_password
- {
- open (DATABASE, "<${root}$database") or print $!;
- if($flocking) {flock DATABASE, 2;}
- while(($thisrow = <DATABASE>))
- {
- if ($thisrow =~ m/^$input{'login'}\|(.*)/)
- {
- &init($thisrow);
- &sendemail($values{'email'}, $from, $subject_lost_password, &tempwiz_to_from);
- $sent = 1;
- }
- }
- if($flocking) {flock DATABASE, 8;}
- close DATABASE;
- if(!$sent){&init_errors; &err($error_message{'login not found'});exit;}
- $input{'action'} = "lost_password_sent";
- &tempwiz;
- exit;
- }