This topic is locked

Email permission request

9/18/2008 9:06:53 AM
ASPRunnerPro General questions
customcode author

I will like to have the system send an email with a permission request. If the user reading the email clicks yes the email checks the check box granted for that record in table task. thx

customcode author 9/19/2008

How are the email activation links generated?

Sergey Kornilov admin 9/21/2008

Open c:\program files\asprunnerpro6.0\source\register.asp in text editor and find the following code snippet which generates activation link:



url = "http://" & request.ServerVariables("SERVER_NAME")

if CStr(request.ServerVariables("SERVER_PORT"))<>"80" then _

url = url & ":" & request.ServerVariables("SERVER_PORT")

url= url & request.ServerVariables("SCRIPT_NAME")

##if @BUILDER.bNotifyUser##

message=##message REGMAIL_USER1## & " " & url & vbcrlf

##if @BUILDER.bSendActivationLink##

message = message & ##message REGMAIL_USER2## & ":" & vbcrlf

message = message & url & "?a=activate&u=" & server.URLEncode(base64_encode(values("##@BUILDER.strUsernameField s##"))) & "&code="

message = message & server.URLEncode(md5(values("##@BUILDER.strUsernameField s##") & md5(values("##@BUILDER.strPasswordField s##"))))

message = message & vbcrlf & "(" & ##message REGMAIL_USER3## & ")" & vbcrlf & vbcrlf

##endif##
customcode author 9/22/2008

Open c:\program files\asprunnerpro6.0\source\register.asp in text editor and find the following code snippet which generates activation link:




url = "http://" & request.ServerVariables("SERVER_NAME")

if CStr(request.ServerVariables("SERVER_PORT"))<>"80" then _

url = url & ":" & request.ServerVariables("SERVER_PORT")

url= url & request.ServerVariables("SCRIPT_NAME")

##if @BUILDER.bNotifyUser##

message=##message REGMAIL_USER1## & " " & url & vbcrlf

##if @BUILDER.bSendActivationLink##

message = message & ##message REGMAIL_USER2## & ":" & vbcrlf

message = message & url & "?a=activate&u=" & server.URLEncode(base64_encode(values("##@BUILDER.strUsernameField s##"))) & "&code="

message = message & server.URLEncode(md5(values("##@BUILDER.strUsernameField s##") & md5(values("##@BUILDER.strPasswordField s##"))))

message = message & vbcrlf & "(" & ##message REGMAIL_USER3## & ")" & vbcrlf & vbcrlf

##endif##


I have tried the following and TR is the the record ID and the email address is already passed into the email.

I am doing this in the event Function BeforeEdit(dict, where, oldvalues,keys,message,inline) and server.URLEncode does not appear to be working
url = "http://"; & request.ServerVariables("SERVER_NAME")

if CStr(request.ServerVariables("SERVERPORT"))<>"80" then

url = url & ":" & request.ServerVariables("SERVER_PORT")

url= url & request.ServerVariables("SCRIPT_NAME")

'// send email to user

message = message & url & "?tr=" & task & "?ap=approve&u=" & server.URLEncode(base64_encode(values("UserName"))) & "&code=" message = message & server.URLEncode(md5(values("UserName") & md5(values("PassWord"))))

Sergey Kornilov admin 9/22/2008

You need to clarify what "server.URLEncode does not appear to be working" means.

customcode author 9/23/2008

It does not encode it the whole url is blank in the email. If I comment out the server.URLEncode(base64_encode(values("UserName")))& "&code=" and put something else in its place such as a string it will email the the string.

Sergey Kornilov admin 9/23/2008

Did you replace values("UserName") with your own value you need to encode?