Rhuan Posted September 26, 2013 Share Posted September 26, 2013 (edited) Hi... I'm trying to do one module to send one email to client when anyone wrong password account (like admin) But I'm having problem to get the email on input username, all data $_POST will be send to dologin.php My hook: <?php function hook_loginfail($vars) { if($_SERVER["REQUEST_URI"] = "incorrect=true"){ // echo $whmcs->get_req_var('username'); $command = "sendemail"; $adminuser = "Rhuan"; $values["customtype"] = "general"; $values["customsubject"] = "Login Failed"; $values["custommessage"] = "Olá clientname..."; $values["id"] = 1; // With one selection on database using WHERE emailofclient to get ID, Firstname... $results = localAPI($command,$values,$adminuser); if ($results['result']!="success") echo "An Error Occurred: ".$results['result']; } } add_hook("ClientAreaHeaderOutput",1,"hook_loginfail"); ?> I need the email of client to check on database if exist and get the id to send email address... Thank you very much! Edited September 28, 2013 by WHMCS TedX Reformatted PHP code 0 Quote Link to comment Share on other sites More sharing options...
nandhini Posted September 26, 2013 Share Posted September 26, 2013 You can use an email program – like Microsoft Outlook, Mozilla Thunderbird, Eudora or Apple Mail – to send and receive email from your 123-reg mailboxes. To do this, you need to add a new account to your email program. The exact way of doing this will vary depending on which program you use, but you usually need to find the add new email account option. Please check the user guide for your email program to find out exactly how to do this – there are links to instructions for the most popular mail programs towards the bottom of this page. When adding a new email account, you’ll be asked to supply some details. Enter them as follows: For POP3: Mail account type: POP3 Incoming mail server (POP): pop.123-reg.co.uk Outgoing mail server (SMTP): smtp.123-reg.co.uk For IMAP: Mail account type: IMAP Incoming mail server (IMAP): imap.123-reg.co.uk Outgoing mail server (SMTP): smtp.123-reg.co.uk When adding a new email account, you’ll be asked to supply some details. Enter them as follows: Username: The username for the mailbox (full email address) Password: The password for the mailbox Make sure you choose the outgoing mail server requires authentication option. 0 Quote Link to comment Share on other sites More sharing options...
Rhuan Posted September 26, 2013 Author Share Posted September 26, 2013 Hi, thank you for answer my thread but, I think you don't understand I need to send emails to clients when login failed, like admincp when you insert incorrect password and receive one notification in email... Thanks! 0 Quote Link to comment Share on other sites More sharing options...
callum314 Posted September 26, 2013 Share Posted September 26, 2013 Wouldn't $_SERVER["REQUEST_URI"] actually equal "/login.php?incorrect=true" or "/clientarea.php?incorrect=true" You would be better using $_GET["incorrect"]; 0 Quote Link to comment Share on other sites More sharing options...
Rhuan Posted September 27, 2013 Author Share Posted September 27, 2013 Wouldn't $_SERVER["REQUEST_URI"] actually equal "/login.php?incorrect=true" or "/clientarea.php?incorrect=true" You would be better using $_GET["incorrect"]; Yes, can be... But the problem is how to get the email address of client use to try login in field username. 0 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.