Mail Header Fields Object
Overview
---
Sections
Init, Main, Procedures, OnExit, and Structure.
note
The object is declared in the Declare section.
Properties
Name | Description |
---|---|
All | Returns all headers as a string separated by CR/LF. |
Count | Number of headers. |
Item | Returns the header field at index. |
ObjectIsEmpty | Returns 1 if object is not created. |
LastReturnCode | Returns last known return code from object. |
note
Properties ObjectIsEmpty
and LastReturnCode
are common methods. For more information see Common properties and methods.
Methods
Name | Description |
---|---|
Add | Adds one or more header fields to the collection. |
Clear | Removes all the header fields from the collection. |
Find | Finds a header field in the collection. |
Remove | Removes a header field from the collection. |
CreateObject | Creates a new instance of the object. |
FreeObject | Releases the instance of the object. |
note
Methods CreateObject
and FreeObject
are common methods. For more information see Common properties and methods.
See Also
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"
- Assign the appropriate label (or assign from string variable) to the Label argument.
Example: Content-Type. - Assign the Value argument with the values of the header field.
Example: text/plain;charset="iso-8859-1"
To add multiple header fields
- Assign Null_Label to the Label argument.
- 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
Label | Type: MailHeaderStringLabel |
Value | Type: String |
Unique | Type: 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
Label | Type: MailHeaderStringLabel |
StartAfter | Type: Pointer to Integer Default: NULL Description: If item is not found, this parameter is set to 0. |
Return value | Type: 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
Index | Type: Integer |
Return value | Type: String Description: Contains the removed header field. |
See Also
Mail Header Fields Object::Add
Mail Header Fields Object::Clear
Mail Header Fields Object::Find