Solved

Access VBA send mail corrupts PDF

Posted on 2012-03-14
3
501 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
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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Describes a method of obtaining an object variable to an already running instance of Microsoft Access so that it can be controlled via automation.
MS Outlook is a world-class email client application that is mainly used for e-communication globally.  In this article, we will discuss the basic idea about MS Outlook, its advanced features, and types of MS Outlook File formats.
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

786 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