I'm using the following code to send an email and pdf attachment. The email goes out just fine and the attachment is there when I send to people on the Exchange server, but when I send to outside email addresses, the attachment is gone. (Email arrives OK though)
Any help would be appreciated. I got this code from http://support.microsoft.com/?kbid=313803
' Create an Outlook application.
Dim oApp As Outlook._Application
oApp = New Outlook.Application()
' Create a new MailItem.
Dim oMsg As Outlook._MailItem
oMsg = oApp.CreateItem(Outlook.Ol
oMsg.Subject = "Send Attachment Using OOM in Visual Basic .NET"
oMsg.Body = "Hello World" & vbCr & vbCr
' TODO: Replace with a valid e-mail address.
oMsg.To = "email@example.com"
' Add an attachment
' TODO: Replace with a valid attachment path.
Dim sSource As String = "C:\Temp\Hello.pdf"
' TODO: Replace with attachment name
Dim sDisplayName As String = "Hello.pdf"
Dim sBodyLen As String = oMsg.Body.Length
Dim oAttachs As Outlook.Attachments = oMsg.Attachments
Dim oAttach As Outlook.Attachment
oAttach = oAttachs.Add(sSource, , sBodyLen + 1, sDisplayName)
' Clean up
oApp = Nothing
oMsg = Nothing
oAttach = Nothing
oAttachs = Nothing