close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

Send alert email when a user effect login

Thread began 10/28/2018 9:16 am by Mike | Last modified 10/29/2018 6:21 pm by Mike | 99 views | 5 replies


Send alert email when a user effect login

I need to create this behaviour with "Send Email" of DataBridge (installed 2.3.2 version):

1) login page;
2) send an email to the administrator when a user effect login (with the user's details in the email, included the IP address).

Now I've tried to create this "send email" (see the code below) in the login page but works only if the page not redirect (so the user after clicking "login in", remain in the same page... which also generates a wrong behaviour sending the email every time the user refresh the page).
Is possible to send an email when the user is redirect to the starting restricted page?
Also, how can I include the user's IP address in the email?
if (WA_Auth_RulePasses("Logged in to pcms2_users")) { //WA Universal Email
$Email = new WA_Email("login_2");
$Email->From = "";
$Email->Method = "smtp";
$Email->Host = "";
$Email->Port = "587";
$Email->SMTPAuth = true;
$Email->SMTPSecure = "tls";
$Email->Username = "";
$Email->Password = "password";
$Email->BodyFile = "../../../webassist/email/templates/waue_login.php";
if (function_exists("rel2abs") && $Email->Redirect) $Email->Redirect = $Email->Redirect?rel2abs($Email->Redirect,dirname(__FILE__)):"";
for ($emailGroup=0; $emailGroup<sizeof($Email->To); $emailGroup++) {
$Email->Subject = "Subject email";

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...