Using the Message.Header property
' Example: CSMail VBScript Example 7
' Summary: Using the Message.Header property
' Usage: cscript exvbs07.vbs
' or
' wscript exvbs07.vbs
set MyMsg=CreateObject("CSMail.Message") ' Create the message object
MyMsg.Header("X-ID")="NCC 1701" ' Set a user-defined field
WScript.echo("The X-ID field contains: "&MyMsg.Header("X-ID"))
' Echo the user-defined field
' Show all the MIME message fields
WScript.echo("Dumping all MIME Fields:")
for each field in MyMsg.Header
WScript.echo(field&"="&MyMsg.Header(field))
next
|