R
Russell Stevens
I generate pdf files on my server and allow users to access them via a
browser and also email them. Most files work fine whether the user uses his
browser or gets an email with a pdf attachment which he can then open with
Acrobat. All my pdf files work fine via a browser, but some are corrupted
by one byte when sent as an email attachment. The problem is 100%
reproducible - the code is trivial. Am I missing something obvious or is
this a bug with SmtpMail. ie
Imports System.Web.Mail
Dim ms As New MailMessage
ms.To = "(e-mail address removed)"
ms.From = "(e-mail address removed)"
ms.BodyFormat = MailFormat.Text
ms.Subject = "Test"
ms.Body = "Test Message"
Dim mattach As New MailAttachment("c:\temp\temp.pdf")
ms.Attachments.Add(mattach)
SmtpMail.Send(ms)
The pdf file is 16453 bytes. If retrieved via a browser, then view/saved it
is still 16453 bytes. If the exact same file is emailed as an attachment
using the above code, the attachment is one byte less at 16452 bytes.
Acrobat considers it a corrupt file and won't open it. Other pdf files do
not have this problem when emailed. I suspect the problem has nothing to do
with pdf files, but that some attachments are just clipped by 1 byte.
If I email the exact same file using an email program, the file is not
clipped by one byte.
Anyone seen this, have a workaround, or suggestions?
Thanks
Russ Stevens
browser and also email them. Most files work fine whether the user uses his
browser or gets an email with a pdf attachment which he can then open with
Acrobat. All my pdf files work fine via a browser, but some are corrupted
by one byte when sent as an email attachment. The problem is 100%
reproducible - the code is trivial. Am I missing something obvious or is
this a bug with SmtpMail. ie
Imports System.Web.Mail
Dim ms As New MailMessage
ms.To = "(e-mail address removed)"
ms.From = "(e-mail address removed)"
ms.BodyFormat = MailFormat.Text
ms.Subject = "Test"
ms.Body = "Test Message"
Dim mattach As New MailAttachment("c:\temp\temp.pdf")
ms.Attachments.Add(mattach)
SmtpMail.Send(ms)
The pdf file is 16453 bytes. If retrieved via a browser, then view/saved it
is still 16453 bytes. If the exact same file is emailed as an attachment
using the above code, the attachment is one byte less at 16452 bytes.
Acrobat considers it a corrupt file and won't open it. Other pdf files do
not have this problem when emailed. I suspect the problem has nothing to do
with pdf files, but that some attachments are just clipped by 1 byte.
If I email the exact same file using an email program, the file is not
clipped by one byte.
Anyone seen this, have a workaround, or suggestions?
Thanks
Russ Stevens