R
Russell Stevens
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 = "(e-mail address removed)"
ms.From = "(e-mail address removed)"
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
Imports System.Web.Mail
Dim ms as New MailMessage
Dim mattach As New MailAttachment("FullPathToPDFFile",MailEncoding.UUEncode)
ms.To = "(e-mail address removed)"
ms.From = "(e-mail address removed)"
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