Setting Internet Headers for Outlook Mail Item

S

Sue Lusk

I am using the following to create a new email with an
attachent. The other thing I need to do is set the CONTENT-
TYPE, CONTENT-DISPOSITION and CONTENT-TRANSFER-ENCODING
internet headers. Does anyone know how to do this?


Set myOlApp = CreateObject("Outlook.Application")
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder
(olFolderInbox)
Set myItem = myOlApp.CreateItem(0)
Set myRecipient = myItem.Recipients.Add("some email
address")
Set myAttachments = myItem.Attachments
myAttachments.Add "my file name", olByValue, 1, "..."
myItem.Subject = "........"
myItem.Body = "...."
 
D

Dmitry Streblechenko

There is a trick that lets you set/replace internet headers on the outgoing
messages, but you cannot change headers on the attachments - see
http://www.dimastr.com/redemption/faq.htm#14
The example sets the From header, but can be used to set any other header.
The example is Redemption specific, but can also be used in CDO 1.21 or
Extended MAPI (but not in Outlook Object Model).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top