Solved

Email Attachments

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

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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Learn more about how the humble email signature can be used as more than just an electronic business card. When used correctly, a signature can easily be tailored for different purposes by different departments within an organization.
Use email signature images to promote corporate certifications and industry awards.
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

747 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

12 Experts available now in Live!

Get 1:1 Help Now