Solved

Access VBA send mail corrupts PDF

Posted on 2012-03-14
3
508 Views
Last Modified: 2012-03-14
I have VBA code that sends PDF documents, if I check the document before sending it looks fine but the recipient receives a corrupted version (Black lines and some pages completely black). BTW we use Exchange 2007

 Set objMessage = CreateObject("CDO.Message")  
    With objMessage
        .Subject = "Test"
        .From = "username@domain.com"
        .To = "username@domain.com"
                 
         objMessage.AddAttachment ("C:\Attach\sample.pdf")
 .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2     .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "xxx.xxx.xxx.xxx"
       .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 2
        .Configuration.Fields.Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = "25"
        .Configuration.Fields.Update
       
        .Send
0
Comment
Question by:HKFuey
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 500 total points
ID: 37719105
This is going to sound ridiculous, but I hit this problem some years ago, and the simple fix was to make sure we included some body text.

Hope this helps
0
 

Author Closing Comment

by:HKFuey
ID: 37719143
FLIPPIN' BRILLIANT!!!!!
IF I COULD GIVE YOU MORE POINTS I WOULD!!!!!!!!!!!!
0
 
LVL 7

Expert Comment

by:markmiddlemist
ID: 37719166
Glad to have spared you the pain we went through on it (trust me, there was lots LOL)
0

Featured Post

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In Part II of this series, I will discuss how to identify all open instances of Excel and enumerate the workbooks, spreadsheets, and named ranges within each of those instances.
Did you know that more than 4 billion data records have been recorded as lost or stolen since 2013? It was a staggering number brought to our attention during last week’s ManageEngine webinar, where attendees received a comprehensive look at the ma…
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
how to add IIS SMTP to handle application/Scanner relays into office 365.

739 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question