Email Attachments are corrupted

From: Russell Stevens (rastevens_at_aol.com)
Date: 03/29/04


Date: Mon, 29 Mar 2004 14:10:11 -0500

What needs to be done to get SmtpMail.Send to work with an attachment - ex.

Imports System.Web.Mail

Dim ms as New MailMessage
Dim mattach As New MailAttachment("FullPathToPDFFile",MailEncoding.UUEncode)
ms.To = "someone@microsoft.com"
ms.From = "me@somewhere.com"
ms.BodyFormat = MailFormat.Text
ms.Subject = "Test"
ms.Body = "Test Message"
ms.Attachments.Add(mattach)
SmtpMail.Send(ms)

I have previously reported that if you do not set the Encoding to UUEncode,
that pdf file attachments will be corrupted (the default is supposed to be
UUEncode but if you do not explicitly set it, it ends up being Base64).
However, some perfectly good pdf files still cannot be emailed as
attachments. The pdf files can be emailed using Outlook, AOL, and any other
email program I have tried, but not from a Win2K server using the above
code. The last two lines of the pdf file are

9369
%%EOF

These two lines are just dropped when the attached pdf file is sent. This is
100% reproducible. These two lines do NOT begin with periods so the metabase
setting for DisablePickupDotStuff should not apply (and from what I can tell
this only applies to IIS 5, not IIS 6).

I am using the 1.1 Framework on a Win2003 server. Microsoft - why doesn't
this work and what needs to be done to get it to work?

Thanks
Russ Stevens



Relevant Pages

  • Report -> Snapshot -> PDF -> Attach To PDF
    ... Some of the reports need to be accompanied by photos stored ... Faxing is the problem, as the FAXCOMEXLib only sends one file at a ... attachments in a PDF file as additional pages (If not, ...
    (microsoft.public.access.reports)
  • Re: Cant open Adobe PDF files as e-mail attachments!! Help
    ... >I just got my new Dell XPS notebook with Windows XP Media edition. ... > attachments. ... > problem opening the same PDF file but I cannot open ... > the PDF file via my XPS ...
    (microsoft.public.windows.mediacenter)
  • Re: PDF Attatchments Wont Open
    ... Something may be corrupting the attachments as the e-mails download. ... Disabling email scanning does not leave you unprotected against ... saved emailed PDF file in notepad. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: PDF files open in garbled text and symbols
    ... let me get this straight. ... try an Adobe support newsgroup. ... If you're trying to open the .pdf file using Word, then, as Suzanne ... attachments to my e-mails. ...
    (microsoft.public.word.application.errors)