<!--#include virtual=\"/dev/_db.asp\"-->
<%
bRequireLogin = True
bDontCount = False
sPageTitle = \"ASP DeV WorX - Messenger\"
bAdminOnly = False
lSubjectID = 0
sTitleBar = \"/dev :: <a href=\"\"/dev/index.asp\"\" class=whitenavlink>home</a> :: messenger\"
%>
<!--#include virtual=\"/dev/_header.asp\"-->
<!--#include virtual=\"/dev/_send.asp\"-->
<br>
<%
sTo = request(\"txtTo\")
if request(\"cmdSend\") <> \"\" then
sFrom = session(\"devUserName\")
sTo = request(\"txtTo\")
sSubject = request(\"txtSubject\")
lDate = Date()
lTime = Time()
sBody = request(\"txtBody\")
OpenDB sConnUsers
sSQL = \"SELECT * FROM Users WHERE UserName = \'\" & sTo & \"\'\"
rs.open sSQL,,,adCmdTable
if rs.eof or rs.bof then
bWrongRecip = True
end if
if rs(\"NoSend\") = True then
bNoSend = true
end if
if rs(\"MessengerNotify\") = True then
bNotify = true
sEmail = rs(\"Email\")
end if
if bWrongRecip = True then
bErr = true
sErr = \"No such user as \"\"\" & sTo & \"\"\" exists!\"
end if
if bNoSend = True then
bErr = true
sErr = \"You cannot send messages to this user because he/she is antisocial.\"
end if
if sSubject = \"\" then
bErr = True
sErr = \"Please enter a subject!\"
end if
if sBody = \"\" then
bErr = true
sErr = \"Please enter a message!\"
end if
if not bErr then
OpenDB sConnMessages
sSQL = \"SELECT * FROM Messages\"
rs.Open sSQL,,,adCmdTable
rs.AddNew
rs(\"From\") = sFrom
rs(\"To\") = sTo
rs(\"Subject\") = sSubject
rs(\"Date\") = lDate
rs(\"Time\") = lTime
rs(\"Body\") = sBody
rs.Update
MessageID = rs(\"MessageID\")
CloseDB
if bNotify = true then
sFrom = \"pctek@ripnet.com\"
sBody = \"You have received a DeV Messenger message from: \" & sTo & vbCrLf & vbCrLf
sBody = sBody & \"Click on the following link to read your message:\" & vbCrLf
sBody = sBody & \"
http://dev.idleplay.net/dev/live/messenger/showmessage.asp?mid=\" & MessageID
\'TO DO: Select your mail configuration (see _send.asp)
SendCDOMail sEmail, sSubject, sBody, sFrom
end if
%>
<p class=\"smallaction\">Message Sent!</a>
<p class=\"smallerheader\">The message will be received by <%=sTo%> instantly.</p>
<p class=\"smallertext\"><a href=\"/dev/live/messenger/index.asp\">Click here</a> to return to your Messenger Box.</p>
<p class=\"smallertext\"><a href=\"/dev/myDeV/default.asp\">Click here</a> to go to myDeV.</p>
<!--#include virtual=\"/dev/_footer.asp\"-->
<%
response.end
end if
end if
if request(\"cmdReply\") <> \"\" then
sTo = request(\"to\")
sSubject = \"RE: \" & request(\"subject\")
sBody = request(\"body\")
end if
if request(\"cmdFwd\") <> \"\" then
sSubject = \"Fwd: \" & request(\"subject\")
sBody = request(\"fwdBody\")
end if
if request(\"cmdCancel\") <> \"\" then
response.redirect \"/dev/live/messenger/index.asp\"
end if
%>
<p class=\"smallaction\">
Send Message
</p>
<p class=\"smallertext\">
To send a message, please fill out the form below. In the \"To\" field, enter the <strong>recipient\'s exact username</strong>,
or else the message cannot be sent.
</p>
To send a message to Chris [webmaster] <B><a href=\"sendmessage.asp?cmdsend=1&txtTo=chris\">click here</a></B>.
<p class=\"smallaction\"><%=sErr%></p>
<form action=\"sendmessage.asp\" method=\"post\">
<table border=0>
<tr>
<td class=\"smallerheader\">To</td>
<td><input type=\"text\" name=\"txtTo\" class=\"tbflat\" value=\"<%=sTo%>\"></td>
</tr>
<tr>
<td class=\"smallerheader\">Subject</td>
<td><input type=\"text\" name=\"txtSubject\" class=\"tbflat\" value=\"<%=sSubject%>\"></td>
</tr>
<tr>
<td class=\"smallerheader\">Message</td>
<td><textarea cols=40 rows=5 name=\"txtBody\" class=\"tbflat\"><%=sBody%></textarea></td>
</tr>
<tr>
<td></td>
<td><input type=\"submit\" name=\"cmdSend\" value=\" Send! \" class=\"cmdflat\"></td>
</tr>
</table>
</form>
<p class=\"smallerheader\">NOTE: To specify a new line, you must type <br>. Simply pushing enter won\'t cut it.</p>
<br><br>
<!--#include virtual=\"/dev/_footer.asp\"-->