HOWTO: Use PS_INTERNET_HEADERS with cdo 1.21 for custom properties

How to use PS_INTERNET_HEADERS with CDO 1.21 for custom properties.

'This example uses PS_INTERNET_HEADERS for setting a custom property

const smbx="mymailbox"  ' TODO: Change
const ssrv="myserver"      ' TODO: Change
const mycdoInetPset = "8603020000000000C000000000000046"
const myXheader = "X-SPAM"  ' TODO: Change to your property

set oses=createobject("mapi.session")
oses.logon "", "", false, true, 0, true, ssrv & vblf & smbx
set omsg=oses.inbox.messages.getfirst
wscript.echo sfrom
omsg.fields.add myXheader, vbString, "I Hate Spam!", myCdoInetPset

set omsg=nothing
set oses=nothing

Skip to main content