leederbyshire.com

FAQ

email For more information:
email

I reply to email ASAP, but it may not reach you if you use a non-auto-whitelist mail filter.

RSS

MSExchange.org Reader's choice OWA Addons 1st runner-up

Microsoft MVP

OISV

ShareIt!

 M a i l t o :   H y p e r l i n k s   A n d   O W A   2 0 0 7

Back to Articles page

MS Outlook Web Access 2007 and Mailto: hyperlinks, by Lee Derbyshire

Prompted by the interest in my similar article about making OWA 2003 the default mail client, here is one for OWA 2007. As it turned out, removing the mailto: part from the address displayed in the new message window was much harder than it used to be. I think the solution below works okay, though.

Use Notepad to create a file named OWAMailto.vbs, containing the code below, and then double-click it to create the required registry values. Remember to change the value of strURL to your normal OWA URL before you double-click it.

' Insert your OWA URL between the quotes below, assigning a value to strURL.
' Remember to begin the URL with https if you use SSL
' Examples: "http://owa.mydomain.com/exchange", "https://192.168.1.1/exchange"
strURL = ""
If strURL <> "" Then
  Set objWSHShell = WScript.CreateObject("WScript.Shell")
  With objWSHShell
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\", _
      "Outlook Web Access", "REG_SZ"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\Protocols\mailto\", _
      "URL:MailTo Protocol", "REG_SZ"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\Protocols\mailto\URL Protocol", _
      "", "REG_SZ"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\Protocols\mailto\EditFlags", _
      &H00000002, "REG_BINARY"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\Protocols\mailto\DefaultIcon\", _
      "%ProgramFiles%\Outlook Express\msimn.exe,-2", "REG_EXPAND_SZ"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\shell\open\command\", _
      """%ProgramFiles%\Internet Explorer\iexplore.exe"" ", "REG_EXPAND_SZ"
    .RegWrite "HKLM\SOFTWARE\Clients\Mail\OWA\Protocols\mailto\shell\open\command\", _
      """%ProgramFiles%\Internet Explorer\iexplore.exe""" & _
      " " & strURL & "/?ae=Item&t=IPM.Note&a=New&to=%1", "REG_EXPAND_SZ"
    .RegWrite "HKLM\SOFTWARE\Classes\mailto\shell\open\command\", _
      """%ProgramFiles%\Internet Explorer\iexplore.exe""" & _
      " " & strURL & "/?ae=Item&t=IPM.Note&a=New&to=%1", "REG_EXPAND_SZ"
  End With
  Set objWSHShell = Nothing
  WScript.Echo "Registry entries successfully created"
Else
  WScript.Echo "You must edit this file in Notepad" & _
  ", and assign a valid OWA URL to the variable strURL"
End If

Unfortunately, the New Mail page ends up being populated with an address that still has mailto: at the beginning.

To get rid of the mailto: part, you will need to edit one of your server-side OWA .js files. Locate the file named uglobal.js . At the time of writing, it is in Program Files\Microsoft\Exchange Server\ClientAccess\Owa\8.1.240.5\scripts\premium although that numbered folder name will change with future service packs. Make a copy of the file, and then open it in Notepad. Scroll down to the function window.onload, which should look like this:

function window.onload(){chkScrpts();}
Insert a few lines after the opening brace, so that it look like this:
function window.onload()
{
  chkScrpts();
  if(window.location.href.indexOf("?ae=Item&t=IPM.Note&a=New&to=mailto:") != -1)
  {
    var strMsgTo = document.all.spnR.innerText;
    if(strMsgTo.toUpperCase().substring(0, 7) == "MAILTO:")
      document.all.divTo.innerText = strMsgTo.substring(7);
  }
}

Now the mailto: part of the email address should disappear soon after the form is displayed.

Note - your clients will need to clear their Temporary Internet Files before this will work because the original .js file is usually cached client-side.


Copyright © Lee Derbyshire 2008.