If you need to have Outlook File Template (.oft) to open via a click on a landing page, be aware that .oft is not part of the default mime types and it has to be manually added. If you try to open an OFT link with default settings, you will be getting a 404 error.
You can add the Mime Type via IIS Manager or directly editing the web.config file in root directory.
Adding MIME Type from IIS Manager
-
On IIS, click on the site application on the left pane and double-click on the MIME Types icon.
-
On the right pane, click Add… and type in the extension for File name extension: and the application type under MIME type:. In this case, you want to type in “.oft” and “application/vnd.ms-outlook” (without quotes) respectively.
- Click OK and restart IIS.
Adding MIME Type Directly to web.config
The second way to add a MIME type is by directly modifying the web.config file under your root directory. Adding one line on top of the web.config from the ETags configuration example, we just need to add one line as highlighted in example below:
<system.webServer> <staticContent> <mimeMap fileExtension=".oft" mimeType="application/vnd.ms-outlook" /> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="5.00:00:00" setEtag="false" /> </staticContent> </system.webServer>
Typically you want to also include Outlook MSG File (.msg) in your MIME Types. In this case, you just need to add another line in your web.config file like so:
<system.webServer> <staticContent> <mimeMap fileExtension=".oft" mimeType="application/vnd.ms-outlook" /> <mimeMap fileExtension=".msg" mimeType="application/vnd.ms-outlook" /> <clientCache cacheControlMode="UseMaxAge" cacheControlMaxAge="5.00:00:00" setEtag="false" /> </staticContent> </system.webServer>
Keep in mind, even if you add MIME types with IIS Manager, it will modify the web.config so you only need to choose either one, not both.
Further Reading
How do I open Outlook Template Files in the client application from a document library?
Opening .msg e-mails in Outlook from a SharePoint 2010 document library.
MIME Types
How to Serve AVIF Image on IIS
How to Serve WebP image on IIS
Leave a Reply