Method MIMEMessage():addHeader() Professional

Adds a header field.

Syntax
:addHeader( <cName>, <xValue> ) --> NIL
Parameters
<cName>
This parameter is a character string describing the name of the header field to add to the e-mail.
<xValue>
This value is a character string of an object which is added to the header. If this parameter is an object, it must have a method :getString()
Return

The return value is NIL.

Description

The method :addHeader() provides a generalized way for adding header fields to an e-mail. It can be used for adding headers for which no specific add method exists in the MIMEMessage class. Examples for such headers are the reply address, the carbon copy address or the blind copy address fields:

oMimeMessage:addHeader( "Reply-To", "user1@mail.com" ) 
oMimeMessage:addHeader( "Cc"      , "user2@mail.com" ) 
oMimeMessage:addHeader( "Bcc"     , "user3@mail.com" ) 

If <cName> is "From", "Date", "Subject", "Content-Type" or "Content-Transfer-Encoding", the header field is added only if it doesn't exist. Otherwise, the existing header value is replaced with the value specified in <xValue>. This is because these header fields may be defined only once in an e-mail message.

Feedback

If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.