redheadpgr
Programmer
I'm using VB.NET with the following code to attach a PDF file to an email message:
Dim myMessage As New MailMessage
myMessage.From = "me@mycompany.com"
myMessage.To = "someone@anothercompany.com"
myMessage.Subject = "Monthly Report"
myMessage.Attachments.Add(New MailAttachment("c:\myfolder\ExportFile.pdf"))
SmtpMail.SmtpServer = "my_smtpserver"
SmtpMail.Send(myMessage)
Of course, at the top of the form I add the following:
Imports System.Web.Mail
The PDF file is created on a previous screen in my application.
The problem appears to be that the PDF file gets corrupted when it gets attached and sent. I've looked at the created file on the drive and it is okay.
Any clues would be very helpful.
Dim myMessage As New MailMessage
myMessage.From = "me@mycompany.com"
myMessage.To = "someone@anothercompany.com"
myMessage.Subject = "Monthly Report"
myMessage.Attachments.Add(New MailAttachment("c:\myfolder\ExportFile.pdf"))
SmtpMail.SmtpServer = "my_smtpserver"
SmtpMail.Send(myMessage)
Of course, at the top of the form I add the following:
Imports System.Web.Mail
The PDF file is created on a previous screen in my application.
The problem appears to be that the PDF file gets corrupted when it gets attached and sent. I've looked at the created file on the drive and it is okay.
Any clues would be very helpful.