Back to product page

Headers Property


References collection of headers for the message.

Syntax

  • Basic
object.Headers [= value]
The Headers(object,value) syntax has these parts:
objectAn expression evaluating to an object of type SmtpMsg
valueA value.

Remarks

This property gives you access to collection of all headers contained in the message. You can get their total Count, and access each and one of them, when needed. You can also Add new headers to the message if you want.

To access specific header in the collection, you can reference it by its index, or by its name. For example, if you want to find sender of the message you can do it like this:
Message.Headers.Items("From").Value

or
Message.Headers("From").Value

and in most cases you don't have to use Value at all - you can just use
Messages.Headers("From") = "WeOnlyDo!"

and it will work.

Platforms

Windows