Solved

Email Attachments

Posted on 2009-07-09
1
204 Views
Last Modified: 2013-11-30
I am creating an email using RFC-822 Email Standards that I place in a pickup directory for Outlook to process.  Everything works fine except that I now want to send pdf attachments as part of the email that I create and do not know what to specify.

I create a plain text/html email by specifying the following:
MIME-Version: 1.0
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: quoted-printable

What additional code do I need to write to send pdf attachments to the email that I'm creating and sending to the pickup directory for Outlook.
0
Comment
Question by:BISCO3
[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
1 Comment
 
LVL 20

Accepted Solution

by:
darbid73 earned 500 total points
ID: 24815280
You are going to have an object called "msgOutlook" which will be your email object.  From this object as you can see below you will be able to give your email all the properties that you want including subject and email address etc.

You will then be able to save this emil, or move it to your folder.

To add the attachment you will need the path which is the most important.  

For me I wanted to add the attachment in the email body so I used a position like this

AttachmentPosition = Len("your body text") - 6

But you really need to play around with this cause I was never really happy with it.

to understand all the properties of the Attachment see this http://msdn.microsoft.com/en-au/library/aa210902(office.11).aspx

With msgOutlook
    If Len(AttachmentPath) > 0 Then
    .Save
    .Attachments.Add AttachmentPath, olByValue, AttachmentPosition, AttachmentName
    End If
    .BodyFormat = olFormatRichText
    .Subject = "your subject text"
    .To = strTo
    .body = "your body text"
    .display
End With

Open in new window

0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

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

Large Outlook files lead to various unwanted errors and corruption issues. Furthermore, large outlook files can also make Outlook take longer to start-up, search, navigate, and shut-down. So, In this article, i will discuss a method to make your Out…
Phishing attempts can come in all forms, shapes and sizes. No matter how familiar you think you are with them, always remember to take extra precaution when opening an email with attachments or links.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…
Suggested Courses

626 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