This topic is locked

Session variables in events?

12/4/2007 11:32:08 AM
ASPRunnerPro General questions
author

Can anyone tell me how to script an event so that the user's username is included in the body of an email sent to me after a successful login?
Thanks.

S
stealthwifi 12/4/2007

I use the following code to accomplish this:
[codebox]
'** Send simple email ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
email="address@email.com"

message="Successfull Login" & vbcrlf

message=message & UCase(postvalue("username")) & vbcrlf

message=message & Request.ServerVariables("REMOTE_ADDR")

subject="Security"

sendmail email, subject, message[/codebox]
This sends an email with the login name used and the IP address
I use this for Successfull & Unsuccessfull logins
Cheers,

Stealth-

501305 12/4/2007

You, Sir/Ma'am, are a genius! Works perfectly and even provides the IP address! Thanks!

I use the following code to accomplish this:

[codebox]
'** Send simple email ****

' do not forget to setup email parameters like From, SMTP server etc

' on 'Security->User login settings' dialog
email="address@email.com"

message="Successfull Login" & vbcrlf

message=message & UCase(postvalue("username")) & vbcrlf

message=message & Request.ServerVariables("REMOTE_ADDR")

subject="Security"

sendmail email, subject, message[/codebox]
This sends an email with the login name used and the IP address
I use this for Successfull & Unsuccessfull logins
Cheers,

Stealth-