S
Sai Vajja
Hi
I am trying to send a .pdf document as an email attachment using net.mail.
This email is being sent by a windows service application. After i receive
the email, and when i try to open the attachment, i get the following error
message...
"adobe reader could not open <filename> becuase it is either not a
suppported file type or because the file has been damaged(for example, it was
sent as an email attachment and wasn't correctly decoded)"
Here is a glimpse of the code doing the emailing..
Dim Mail_Message As MailMessage = New MailMessage(objEmail.MailFrom,
objEmail.MailTo)
Dim Server_Name As SmtpClient = New SmtpClient(MailServer)
Dim Port_Number As Int32 = Convert.ToInt32(MailServerPortNumber)
With Mail_Message
.Body = Trim(objEmail.Message)
.Subject = Trim(objEmail.Subject)
.Priority = objEmail.Priority
.IsBodyHtml = True
.BodyEncoding = System.Text.Encoding.Unicode
For Each oAttachment As Attachment In objEmail.Attachments
.Attachments.Add(oAttachment) 'Here is where i am
attaching the file
Next
End With
Server_Name.Send(Mail_Message)
I am trying to send a .pdf document as an email attachment using net.mail.
This email is being sent by a windows service application. After i receive
the email, and when i try to open the attachment, i get the following error
message...
"adobe reader could not open <filename> becuase it is either not a
suppported file type or because the file has been damaged(for example, it was
sent as an email attachment and wasn't correctly decoded)"
Here is a glimpse of the code doing the emailing..
Dim Mail_Message As MailMessage = New MailMessage(objEmail.MailFrom,
objEmail.MailTo)
Dim Server_Name As SmtpClient = New SmtpClient(MailServer)
Dim Port_Number As Int32 = Convert.ToInt32(MailServerPortNumber)
With Mail_Message
.Body = Trim(objEmail.Message)
.Subject = Trim(objEmail.Subject)
.Priority = objEmail.Priority
.IsBodyHtml = True
.BodyEncoding = System.Text.Encoding.Unicode
For Each oAttachment As Attachment In objEmail.Attachments
.Attachments.Add(oAttachment) 'Here is where i am
attaching the file
Next
End With
Server_Name.Send(Mail_Message)