Using FireMail build 70202 or earlier builds I am getting various complaints from clients that they are not able to open the attachment(s). When they try to open them they either get a message that the file is read only or the file is corrupted. The largest number of complaints are when the attachment is an Excel file, but have started receiving that it is also happening to some *.dbf files. There is also an occasional instance when the file is an actual PDF file. If the same file(s) are taken and sent using Outlook there is no problem opening the attachments. There does not seem to any common cause or reason as to why this is occurring. Has anything like this been addressed in the latest build 70312.
Attachment Corruption
Re: Attachment Corruption
Support · Mar 16, 2007Hello,
We have not experienced this error in the past and it has likely not been addressed in the build 70312.
In order for us to troubleshoot the issue, can you please send an email using FireMail to our [^a|mailto:support@cete.com|Support Team^] along with the attachment and also send a separate email to the same email address only with the excel file that is causing the problem using Outlook?
Thanks,
ceTe Software Support Team
Re: Attachment Corruption
Forum member · Mar 17, 2007Doing some more research I have tracked down that the attachment encoding is be sent as Content-Transfer-Encoding: quoted-printable and the Content-Type: application/octet-stream; for both the Excel and *.dbf attachments. When I send the files using Outlook there are being received with the following attirbutes: Content-Transfer-Encoding: base64 with the Excel file having a Content-Type: application/vnd.ms-excel and the *.dbf file Content-Type: application/octet-stream;
I have been able to change the encoding to Base64 using the following code which seems to allow the files to be received with a encoding of Base64
System.IO.FileStream fileStream = new System.IO.FileStream( theFile, System.IO.FileMode.Open );
ceTe.FireMail.Attachment Att = new Attachment( fileStream, theName );
Att.Encoding = AttachmentEncoding.Base64;
I have not been able to modify the ContentType to match the proper content type. Since it defaults to a content type of application/octet-stream which seems to allow the opening of the received attachments, I am wondering do I need to change it to the proper type?
Re: Attachment Corruption
Support · Mar 19, 2007Hello,
The default content type that will likely be used is application/octet-stream because the server most likely does not have the MIME type for recognizing the excel file extension. If Microsoft Office is installed on the server, this MIME type will e recognized.
However, you can set the ContentType explicitly to application/vnd.ms-excel by using the below line of code:
Attachment attachment = new Attachment(@"C:\Temp\ OUTPUT.xls");
attachment.ContentType = "application/vnd.ms-excel";
message.Attachments.Add( attachment );
Thanks,
ceTe Software Support Team
Re: Attachment Corruption
Forum member · Mar 19, 2007I have found out that there must be something happening in how the Encoding is be determined since some of the *.xls are being set to have a encoding of Base64 but the ones that are having problems opening are being encoded as quoted-printable. It seems that if the e-mail was sent to an internal (same domain) address and the user was using Outlook, the attachment would open properly. However when the same e-mail (with attachment) was being sent to a address (outside domain) the attachment might not be allowed to be opened.
Below is how the attachment is be treated when the encoding is set to automatic (Failed) and how it is being handled with the encoding set to Base64 (Worked). It seems that I am going to have to over-ride the automatic setting and force the encoding to Base64, based upon the testing that I have done.
FAILED:
Content-Type: application/octet-stream;
name="500-2892-1.xls"
Content-Transfer-Encoding: quoted-printable
Content-Disposition:attachment;
filename="500-2892-1.xls"
WORKED:
Content-Type: application/vnd.ms-excel;
name="500-2892-1.xls"
Content-Transfer-Encoding: base64
Content-Disposition:attachment;
filename="500-2892-1.xls"