function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Satya Ranjan MohantySatya Ranjan Mohanty 

The file format and extension of 'ExcelfileSC.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?

I am trying to send an E-Mail with an Excel Attachment. Everything works, except I am getting a warning when I am trying to open the send attachment:
The file format and extension of 'ExcelfileSC.xls' don't match. The file could be corrupted or unsafe. Unless you trust its source, don't open it. Do you want to open it anyway?
Here is the relevant part of my code:

<apex:page controller="opportunityQuery" contentType="txt/xml#OpportunityDetails.xlsx" cache="true" readOnly="true"> <apex:outputText value="{!xlsHeader}"/> <Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet" xmlns:html="http://www.w3.org/TR/REC-html40">

Satya Ranjan MohantySatya Ranjan Mohanty

Here is my code

<apex:page controller="opportunityQuery" contentType="txt/xml#OpportunityDetails.xlsx" cache="true" readOnly="true">
<apex:outputText value="{!xlsHeader}"/>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">