724
Views
4
Comments
Solved
Email with Excel attachment
Question

Hi All,

i have written a function that would send email and have an excel attachment. This function is working well but while receiving the email, i am unable to open the attachment, facing below error.

"Excel cannot open file X because the file format or file extension is not valid.Verify that the file has not been corrupted and the file extension matches the file."

The file content is got by converting an ListToExcel and storing this data in an entity, later i am retriving the stored content and passing it as FileContent for the AttachFile function.

Appreciate any help in figuring out the cause of error on opening attachment. Thanks.

2020-03-24 00-01-07
Nuno Gonçalo Pereira
Solution

MS Excel has the following observed MIME types:


  • application/vnd.ms-excel (official .xls)
  • application/msexcel
  • application/x-msexcel
  • application/x-ms-excel
  • application/x-excel
  • application/x-dos_ms_excel
  • application/xls
  • application/x-xls
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx)

Try to use official mime type.


Thanks and Best Regards,

Nuno Pereira



UserImage.jpg
Ashwathram N

Nuno Gonçalo Pereira wrote:

MS Excel has the following observed MIME types:


  • application/vnd.ms-excel (official .xls)
  • application/msexcel
  • application/x-msexcel
  • application/x-ms-excel
  • application/x-excel
  • application/x-dos_ms_excel
  • application/xls
  • application/x-xls
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx)

Try to use official mime type.


Thanks and Best Regards,

Nuno Pereira




Thanks this worked.

2018-06-05 16-54-03
Maria da Graça Peixoto

Hi!

Have you verify if the content is correct, downloading it directly? 

Regards

Graça

UserImage.jpg
Ashwathram N

Maria da Graça Peixoto wrote:

Hi!

Have you verify if the content is correct, downloading it directly? 

Regards

Graça

Hi,


i just created a screen to download the content from the saved entity. it is working well.


2020-03-24 00-01-07
Nuno Gonçalo Pereira
Solution

MS Excel has the following observed MIME types:


  • application/vnd.ms-excel (official .xls)
  • application/msexcel
  • application/x-msexcel
  • application/x-ms-excel
  • application/x-excel
  • application/x-dos_ms_excel
  • application/xls
  • application/x-xls
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx)

Try to use official mime type.


Thanks and Best Regards,

Nuno Pereira



UserImage.jpg
Ashwathram N

Nuno Gonçalo Pereira wrote:

MS Excel has the following observed MIME types:


  • application/vnd.ms-excel (official .xls)
  • application/msexcel
  • application/x-msexcel
  • application/x-ms-excel
  • application/x-excel
  • application/x-dos_ms_excel
  • application/xls
  • application/x-xls
  • application/vnd.openxmlformats-officedocument.spreadsheetml.sheet (xlsx)

Try to use official mime type.


Thanks and Best Regards,

Nuno Pereira




Thanks this worked.

Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.