Method MIMEMessage():addHeader() Professional

Adds a header field.

:addHeader( <cName>, <xValue> ) --> NIL
This parameter is a character string describing the name of the header field to add to the e-mail.
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()

The return value is NIL.


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", "" ) 
oMimeMessage:addHeader( "Cc"      , "" ) 
oMimeMessage:addHeader( "Bcc"     , "" ) 

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.


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.