AddHeader method: MCFBodyPart class

Syntax

AddHeader(HeaderName, HeaderValue)

Description

Use the AddHeader method to add a header to the body part. This method allows for email server customizations. Some commonly used headers are already exposed as properties, such as ContentType and ContentLanguage. Advanced applications can adapt this technique to meet their own requirements. These headers can be either standard SMTP headers or custom headers starting with "X-".

Parameters

Parameter Description

HeaderName

Specify the name of the header that you want to add. This parameter takes a string value.

HeaderValue

Specify the actual text of the header, as a string.

Returns

None.

Example

   Local PT_MCF_MAIL:MCFOutboundEmail &email = create PT_MCF_MAIL:MCFOutboundEmail⇒
();
   Local string &TestName = "Custom Header";
   &email.From = &def.From;
   &email.Recipients = &def.Recipients;
   &email.SMTPServer = &def.SMTPServer;
   &email.Subject = &TestName;
   &email.Text = &TestName;
   &email.AddHeader("X-Mailer", "CRM Sales Application 8.9 SP2");
   &email.AddHeader("X-Mailer", "CRM Sales Application 8.9 SP3");
   &email.AddHeader("X-Mailer", "CRM Sales Application 8.9 SP4");
   &res = &email.Send();