How to send email using outlook redemption with custom internet headers

Hello all,
       I am trying to send a new email using outlook 2003 with custom internet header using, i have done some research and i can't find any way but with using outlook redemption. does anyone have some sample code i can use to do this? i know how to send a normal message without redemption but inserting custom headers is where i am having the issue that and lack of experience with using outlook redemption. anyone know how?
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

I have used redemption quite alot to send mails and manipulate other objects.
The Redemption web site has alot of examples - although you have to work quite hard to find them, and they give you the general idea - not the complete code. The key to understanding the SafeMail item is that you create an Outlook mailitem, and a SafeMail item, and then set SafeMail.item = mailitem. You can now use safemailitem to manipulate your original mail item.
The fields array gives you access to properties you can't get at with Outlook. You have to jump through some hoops to get the correct tag to address the correct field. Redemption includes functions to find the tags - and the second example shows you how to do that. First it gets the tag. THen it adds (logical OR) more HEX to signify the correct field type associeated with that tag.
Here is some sample code & notes  from the site which would be a good starting place...The first example shows basic manipulation of fields on a mail. THe second shows retreiving a tag for a custom header - and setting a value. You will need a combination of the two to achieve your goal.
....There are dozens more properties that might be of interest to you: PR_TRANSPORT_MESSAGE_HEADERS on e-mail items, PR_SEND_RICH_INFO on Recipient objects, etc. Use MdbView or OutlookSpy to see which properties are available.
dim sItem, oItem
set sItem = CreateObject("Redemption.SafeMailItem")
set oItem = Application.Session.GetDefaultFolder(6).Items(1) 'get first e-mail from the Inbox, can be any other item
sItem.Item = oItem
PrSenderEmail = &H0C1F001E
MsgBox sItem.Fields(PrSenderEmail)
Another example on how to use the Fields array. The example shows how to add an extra RFC822 header to a message to be sent. It is assumed that MailItem variable points to an existing Outlook MailItem object. When adding your own headers, the name (second argument to getIDsfromNames) can be pretty-much anything you want, but make sure that the GUID is exactly the same as given below - Outlook only adds named properties with that GUID to the outgoing message headers.
set sItem = CreateObject("Redemption.SafeMailItem")
sItem.Item = MailItem
tag = sItem.GetIDsFromNames("{00020386-0000-0000-C000-000000000046}", "x-test-header")
tag = tag or &H1E     'the type is PT_STRING8
sItem.Fields(Tag) = "test value"
sItem.Subject = sItem.Subject  'to trick Outlook into thinking that something has changed
To find the original go here: and do a page search on 'headers'
[You can probably do all this using the RDO element of Redemption which is a replacement for CDO - and hence works an order of magnitude faster than the outlook object model, but you also increase your learning curve by an order of magnitide!]

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
so did this work  - what problems did you get?
If it worked can you assign points - if not let me know what the problem is.
peterstiAuthor Commented:
sorry for the delay yes it worked thanks.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.