Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Email Attachments

Posted on 2009-07-09
1
Medium Priority
?
209 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 1000 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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

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

This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
Today as you open your Outlook, you witness an error message: “Outlook is using an old copy of your Outlook Data File…”. Probably, Outlook is accessing an old OST file.
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…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses

782 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