MailForm Class Content Studio 5.7 SDK
Content Studio Web Content Management System

[This is preliminary documentation and is subject to change.]

Mails all fields that are posted except those specified in excluded fields property. The MailSent property can be used to see if the mail(s) have been sent.
Inheritance Hierarchy

SystemObject
  ContentStudio.SiteCodeBase
    ContentStudio.Site.ActiveScriptingActiveScriptingBase
      ContentStudio.Site.ActiveScripting.MiscMailForm

Namespace: ContentStudio.Site.ActiveScripting.Misc
Assembly: CS_SiteLib (in CS_SiteLib.dll) Version: 5.7.5016.0 (5.7.5016.0)
Syntax

public sealed class MailForm : ActiveScriptingBase

The MailForm type exposes the following members.

Constructors

  NameDescription
Public methodMailForm
Constructs a new instance of the MailForm class that writes to the default response stream
Public methodMailForm(Stream)
Constructs a new instance of the MailForm class that writes to the supplied stream
Top
Properties

  NameDescription
Public propertyBackwardsComponentCompatibilityMode
Sets or gets a value that indicates whether the code runs in backwards compatibility component mode. The default value is false.
(Inherited from ActiveScriptingBase.)
Public propertyComponentName
Gets the name of the component
(Overrides ActiveScriptingBaseComponentName.)
Public propertyConformance
Gets a value which specifies which type of code a component can generate.
(Overrides ActiveScriptingBaseConformance.)
Public propertyElementType
Gets a value which specifies the type of outer element the component generates.
(Overrides ActiveScriptingBaseElementType.)
Public propertyEncoding
Sets or gets the encoding the component uses. The default encoding is the UTF8 encoding without byte order mark.
(Inherited from ActiveScriptingBase.)
Public propertyExcludeFields
Sets or gets an array of field names that should be excluded from the mail. The default value is null.
Public propertyFieldMailTo
Sets or gets name of the field that contains the comma separated list of recipients of the mail. The default value is "recipients".
Public propertyFieldSubject
Sets or gets name of the field that contains the subject line. The default value is "subject"
Public propertyFrom
Sets or gets the FROM address. The default value is "MailformComponent@contentstudio.se"
Public propertyMailSendMethod
Sets or gets the addressing method to use. The default value is SendMethod.To.
Public propertyMailSent
Gets a value indicating if the mail has been sent. The default value is false.
Public propertyPassword
Sets or gets the password for the mail server. The default value is an empty string
Public propertySendAsPlainText
Sets or gets a value indicating if the mail should be sent as plain text. The default value is false (sending it as HTML instead).
Public propertyServerName
Sets or gets the name or IP address of the mail server. The default value is an empty string.
Public propertyStaticMailTo
Sets or gets the comma separated list of recipients to use if no data is available via FieldMailTo. The default value is an empty string.
Public propertyStaticSubject
Sets or gets the subject subject line to use if no data is available via FieldSubject. The default value is an empty string
Public propertyTextAfter
Sets or gets the text to display in the mail body after the generated content. The default value is an empty string
Public propertyTextBefore
Sets or gets the text to display in the mail body before the generated content. The default value is an empty string
Public propertyUsername
Sets or gets the username to be used with the mail server. The default value is an empty string
Top
Methods

  NameDescription
Public methodEquals (Inherited from Object.)
Public methodGetHashCode (Inherited from Object.)
Public methodGetType (Inherited from Object.)
Public methodInvoke
Invokes the component and sends the mail according to the specifications.
Public methodCode exampleSendMail
Sends a mail with specific content and settings. Use this method if you want to customize the content of the mail, instead of calling the Invoke method.
Public methodToString (Inherited from Object.)
Top
Remarks

To use this class, create an instance of this object, and call the Invoke method with an appropriate set of parameters and properties. This class generates inline code, thus you must wrap it into a block element to make the page validate according to the HTML/XHTML regulations. The generated code is fully HTML/XHTML strict compatible.
Examples

The following code demonstrates how to use the MailForm class
MailForm mf = new MailForm();
mf.ServerName = "mailserver";
mf.StaticMailTo = "info@contentstudio.se";

// Invoke will do the mail sending if a form posts to this page
mf.Invoke();
See Also

Reference