Solved

Email Attachments

Posted on 2009-07-09
1
200 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Guide on using PGP email encryption 4 53
Microsoft Outlook 2016/365 1 31
Outlook 2016 do not search 4 51
Folder Assist on public folder missing outlook 2016 1 20
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
When you’re making plans to join the modern business race, you should analyze various details that may affect your results. Nowadays, millions of businesses are trying to grow into established and appreciated professional enterprises.
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…
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…

756 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