Skip to main content
Version: 4.2.5

Mail Header Fields Object

Overview

---

Sections

Init, Main, Procedures, OnExit, and Structure.

note

The object is declared in the Declare section.

Properties

NameDescription
AllReturns all headers as a string separated by CR/LF.
CountNumber of headers.
ItemReturns the header field at index.
ObjectIsEmptyReturns 1 if object is not created.
LastReturnCodeReturns last known return code from object.
note

Properties ObjectIsEmpty and LastReturnCode are common methods. For more information see Common properties and methods.

Methods

NameDescription
AddAdds one or more header fields to the collection.
ClearRemoves all the header fields from the collection.
FindFinds a header field in the collection.
RemoveRemoves a header field from the collection.
CreateObjectCreates a new instance of the object.
FreeObjectReleases the instance of the object.
note

Methods CreateObject and FreeObject are common methods. For more information see Common properties and methods.

See Also

Mail Message Object

Properties


All

Returns all header fields as a string separated by CR/LF.

Use this property to return the header fields as a single string. This property does not return a string that is "transport-ready."

Type: String
Default: -
Read: get_All
Write: -

See Also

Mail Header Fields Object::Count
Mail Header Fields Object::Item


Count

Returns the number of headers.

Type: Large Integer
Default: -
Read: get_Count
Write: -

See Also

Mail Header Fields Object::All
Mail Header Fields Object::Item


Item

Returns the header fields index.

Type: Large Integer
Default: -
Read: get_Item
Write: -

See Also

Mail Header Fields Object::All
Mail Header Fields Object::Count


Methods


Add

To add one header field

Add one or more header fields to the collection. A header field is a label, followed by a colon, followed by a space, followed by one or more values separated by semicolons.
Example: Content-Type: text/plain;charset="iso-8859-1"

  1. Assign the appropriate label (or assign from string variable) to the Label argument.
    Example: Content-Type.
  2. Assign the Value argument with the values of the header field.
    Example: text/plain;charset="iso-8859-1"
To add multiple header fields
  1. Assign Null_Label to the Label argument.
  2. Assign all the complete header fields, separated by CR/LF pairs, to the Value argument.
    Example: Content-Type: text/plain;charset="iso-8859-1"<CR/LF>MIME-Version: 1.0

Parameters

LabelType: MailHeaderStringLabel
ValueType: String
UniqueType: ParamTypeBool

Default: False_Value

See Also

Mail Header Fields Object::Clear
Mail Header Fields Object::Find
Mail Header Fields Object::Remove
MailHeaderStringLabel


Clear

Removes all the objects from the collection.

Parameters

---

See Also

Mail Header Fields Object::Add
Mail Header Fields Object::Find
Mail Header Fields Object::Remove


Clear

Finds a header field in the collection.

This method searches the collection for a label. On return, StartAfter is updated to reflect the index of the label found, allowing you to find multiple header fields having the same label. StartAfter cannot be a constant since the method updates its value.

If you assign a constant value to StartAfter, a run-time error is generated. If you set the StartAfter value to zero, the search will start at the beginning of the collection.

If the item is not found, StartAfter is set to 0 and "" is returned.

Parameters

LabelType: MailHeaderStringLabel
StartAfterType: Pointer to Integer

Default: NULL

Description: If item is not found, this parameter is set to 0.
Return valueType: String

Default: -

Description: Returns "", if item is not found.

See Also

Mail Header Fields Object::Add
Mail Header Fields Object::Clear
Mail Header Fields Object::Remove
MailHeaderStringLabel


Remove

Removes a header field from the collection.

Index of header field to remove from collection.

Parameters

IndexType: Integer
Return valueType: String

Description: Contains the removed header field.

See Also

Mail Header Fields Object::Add
Mail Header Fields Object::Clear
Mail Header Fields Object::Find