Using the Message.Header property
// Example: CSMail VBScript Example 7
// Summary: Using the Message.Header property
// Usage: cscript exjs07.vbs
// or
// wscript exjs07.vbs
MyMsg=new ActiveXObject("CSMail.Message"); // Create a 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:")
headers=new Enumerator(MyMsg.Header);
for (;!headers.atEnd();headers.moveNext()) {
WScript.echo(headers.item()+"="+MyMsg.Header(headers.item()));
}
|