<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'
' OUTLOOK WEB ACCESS MAILTO REDIRECTOR v0.02 (2006-06-19 17:14)
'
' This page will take a mailto link passed via GET into its "mailto" parameter
' and redirect the user to a new OWA mail message with the recipient filled in.
'
' For this to work properly, the "URL:MailTo Protocol" filetype in Windows needs
' to be registered to launch this page with the following command:
'
' "c:\program files\internet explorer\iexplore.exe" http://server/path/exchredir.asp?mailto=%1
'
strExchangeServer = "exchange"
strUsername = Right(Request.ServerVariables("Logon_User"),Len(Request.ServerVariables("Logon_User"))-InStr(1,Request.ServerVariables("Logon_User"),"\"))
strRecipient = Request.QueryString("mailto")
' remove the "mailto:" portion
strRecipient = Right(strRecipient,Len(strRecipient)-7)
' remove any extra guff such as "?subject=Sales" which
' sits after the email address in the link
If (InStr(1,strRecipient,"?")) Then
'this stores the subject line in a variable in case we find a way of using it later
strSubject = Right(strRecipient,Len(strRecipient)-InStr(1,strRecipient,"="))
strRecipient = Left(strRecipient,InStr(1,strRecipient,"?")-1)
End If
' construct the URL on our server
strRedirectURL = "http://" & strExchangeServer & "/exchange/" & strUsername & "/drafts/?cmd=new&mailtoaddr=" & strRecipient
%>
<html>
<head>
<title>OUTLOOK WEB ACCESS MAILTO REDIRECTOR</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body>
Loading Outlook Web Access, please wait.
If this page does not disappear after 10 seconds please contact technical support.
<script language="JavaScript">
window.open("<%=strRedirectURL%>","","toolbars=no,width=750,height=700,resizable");
self.opener = this;
self.close();
</script>
</body>
</html>