Solved

Access VBA send mail corrupts PDF

Posted on 2012-03-14
3
498 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
  • 2
3 Comments
 
LVL 7

Accepted Solution

by:
markmiddlemist earned 500 total points
Comment Utility
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
Comment Utility
FLIPPIN' BRILLIANT!!!!!
IF I COULD GIVE YOU MORE POINTS I WOULD!!!!!!!!!!!!
0
 
LVL 7

Expert Comment

by:markmiddlemist
Comment Utility
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)

Join & Write a Comment

We are happy to announce a brand new addition to our line of acclaimed email signature management products – CodeTwo Email Signatures for Office 365.
Easy CSR creation in Exchange 2007,2010 and 2013
In Microsoft Access, learn how to use Dlookup and other domain aggregate functions and one method of specifying a string value within a string. Specify the first argument, which is the expression to be returned: Specify the second argument, which …
With Microsoft Access, learn how to start a database in different ways and produce different start-up actions allowing you to use a single database to perform multiple tasks. Specify a start-up form through options: Specify an Autoexec macro: Us…

744 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now