Setting Internet Headers for Outlook Mail Item

  • Thread starter Thread starter Sue Lusk
  • Start date Start date
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 = "...."
 
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
 
Back
Top