Overview

Packages

  • Actions
  • Codegen
  • Controls
    • Base
  • DatabaseAdapters
  • Events
  • None
  • Sessions
  • Tests

Classes

  • AbstractControl_CodeGenerator
  • AjaxTimingForm
  • BasicForm
  • BasicOrmTests
  • BBCodeParser
  • CacheTests
  • CalculatorForm
  • CalculatorWidget
  • ComplexColumn
  • DataRepeaterExample
  • Event
  • ExampleCheckColumn1
  • ExampleCheckColumn2
  • ExampleForm
  • Examples
  • ExampleService
  • ExamplesForm
  • ExampleSingleForm
  • ExpandAsArrayTests
  • HtmlJqDoc
  • InjectForm
  • JavaScriptHelper
  • JqAttributes
  • JqControlGen
  • JqDoc
  • JqIcon
  • Method
  • ModelConnectorTests
  • MyControl
  • MyQSlider_ChangeEvent
  • NavPanel
  • NestedTabForm
  • Option
  • Order
  • PaginatorForm
  • ParamsForm
  • PersistentExampleForm
  • PersonEditPanel
  • PluginEditForm
  • PluginManagerForm
  • Project
  • ProjectEditPanel
  • ProjectListForm
  • ProjectPickerListBox
  • ProjectViewPanel
  • QAbstractCacheProvider
  • QAbstractHtmlTableColumn
  • QAbstractHtmlTableDataColumn
  • QAccordion
  • QAccordion_ActivateEvent
  • QAccordion_BeforeActivateEvent
  • QAccordion_CreateEvent
  • QAccordionBase
  • QAccordionGen
  • QAction
  • QActionControl
  • QAjaxAction
  • QAjaxControlAction
  • QAjaxResponse
  • QAlertAction
  • QApplication
  • QApplicationBase
  • QArchive
  • QAutocomplete
  • QAutocomplete_ChangeEvent
  • QAutocomplete_CloseEvent
  • QAutocomplete_CodeGenerator
  • QAutocomplete_CreateEvent
  • QAutocomplete_FocusEvent
  • QAutocomplete_OpenEvent
  • QAutocomplete_ResponseEvent
  • QAutocomplete_SearchEvent
  • QAutocomplete_SelectEvent
  • QAutocomplete_SourceEvent
  • QAutocompleteBase
  • QAutocompleteBase_CodeGenerator
  • QAutocompleteGen
  • QAutocompleteListItem
  • QBackspaceKeyEvent
  • QBaseClass
  • QBlockControl
  • QBlurControlAction
  • QBlurEvent
  • QBorderCollapse
  • QBorderStyle
  • QBrowserType
  • QButton
  • QButtonBase
  • QCache
  • QCacheDeleteAction
  • QCacheDeleteAllAction
  • QCacheProviderAPC
  • QCacheProviderLocalMemory
  • QCacheProviderLocalMemoryTest
  • QCacheProviderMemcache
  • QCacheProviderNoCache
  • QCacheProviderProxy
  • QCacheSetAction
  • QCalendar
  • QCalendarType
  • QCallType
  • QCausesValidation
  • QCellClickEvent
  • QChangeEvent
  • QCheckBox
  • QCheckBox_CodeGenerator
  • QCheckBoxBase_CodeGenerator
  • QCheckBoxLegacyColumn
  • QCheckBoxList
  • QCheckBoxList_CodeGenerator
  • QCheckBoxListBase_CodeGenerator
  • QClickEvent
  • QCodeGen
  • QCodeGenBase
  • QConfirmAction
  • QContextMenuEvent
  • QControl
  • QControl_CodeGenerator
  • QControlBase
  • QControlBase_CodeGenerator
  • QControlBaseTests
  • QControlCategoryType
  • QControlGrouping
  • QControlLabel
  • QControlProxy
  • QConvertNotation
  • QConvertNotationBase
  • QCrossScripting
  • QCryptography
  • QCss
  • QCssAction
  • QCssClassAction
  • QCssTests
  • QCsvTextBox
  • QCursor
  • QDatabaseBase
  • QDatabaseCodeGen
  • QDatabaseFieldBase
  • QDatabaseFieldType
  • QDatabaseForeignKey
  • QDatabaseIndex
  • QDatabaseResultBase
  • QDatabaseRowBase
  • QDatabaseTests
  • QDataGrid
  • QDataGrid_CheckBoxColumn
  • QDataGrid_CodeGenerator
  • QDataGrid_SortEvent
  • QDataGridBase
  • QDataGridBase_CodeGenerator
  • QDataGridLegacy
  • QDataGridLegacyBase
  • QDataGridLegacyColumn
  • QDataGridLegacyRow
  • QDataGridLegacyRowStyle
  • QDataRepeater
  • QDatepicker
  • QDatepicker_BeforeShowDayEvent
  • QDatepicker_BeforeShowEvent
  • QDatepicker_CalculateWeekEvent
  • QDatepicker_ChangeMonthYearEvent
  • QDatepicker_CloseEvent
  • QDatepicker_SelectEvent
  • QDatepicker_SelectEvent2
  • QDatepickerBase
  • QDatepickerBox
  • QDatepickerBox_BeforeShowDayEvent
  • QDatepickerBox_BeforeShowEvent
  • QDatepickerBox_CalculateWeekEvent
  • QDatepickerBox_ChangeMonthYearEvent
  • QDatepickerBox_CloseEvent
  • QDatepickerBox_CodeGenerator
  • QDatepickerBox_SelectEvent
  • QDatepickerBoxBase
  • QDatepickerBoxBase_CodeGenerator
  • QDatepickerBoxGen
  • QDatepickerGen
  • QDateTime
  • QDateTimePicker
  • QDateTimePicker_CodeGenerator
  • QDateTimePickerBase_CodeGenerator
  • QDateTimePickerFormat
  • QDateTimePickerType
  • QDateTimeSpan
  • QDateTimeTests
  • QDateTimeTextBox
  • QDbBackedFormStateHandler
  • QDbBackedSessionHandler
  • QDialog
  • QDialog_BeforeCloseEvent
  • QDialog_ButtonEvent
  • QDialog_CloseEvent
  • QDialog_CreateEvent
  • QDialog_DragEvent
  • QDialog_DragStartEvent
  • QDialog_DragStopEvent
  • QDialog_FocusEvent
  • QDialog_OpenEvent
  • QDialog_ResizeEvent
  • QDialog_ResizeStartEvent
  • QDialog_ResizeStopEvent
  • QDialogBase
  • QDialogBox
  • QDialogGen
  • QDisplayStyle
  • QDoubleClickEvent
  • QDownArrowKeyEvent
  • QDragDropEvent
  • QDraggable
  • QDraggable_CreateEvent
  • QDraggable_DragEvent
  • QDraggable_StartEvent
  • QDraggable_StopEvent
  • QDraggableBase
  • QDraggableGen
  • QDroppable
  • QDroppable_ActivateEvent
  • QDroppable_CreateEvent
  • QDroppable_DeactivateEvent
  • QDroppable_DropEvent
  • QDroppable_OutEvent
  • QDroppable_OverEvent
  • QDroppableBase
  • QDroppableGen
  • QDropZoneGrouping
  • QEmailAttachment
  • QEmailMessage
  • QEmailServer
  • QEmailStringAttachment
  • QEmailTextBox
  • QEnterKeyEvent
  • QErrorAttribute
  • QEscapeKeyEvent
  • QEvent
  • QFieldset
  • QFile
  • QFileAsset
  • QFileAssetBase
  • QFileAssetDialog
  • QFileAssetType
  • QFileControl
  • QFileFormStateHandler
  • QFilterType
  • QFloatTextBox
  • QFloatTextBox_CodeGenerator
  • QFloatTextBoxBase_CodeGenerator
  • QFocusControlAction
  • QFocusEvent
  • QFocusInEvent
  • QFocusOutEvent
  • QFolder
  • QFontFamily
  • QForm
  • QFormBase
  • QFormGen
  • QFormStateHandler
  • QGridLines
  • QHideCalendarAction
  • QHideDialog
  • QHideDialogBox
  • QHListControl
  • QHListItem
  • QHorizontalAlign
  • QHtml
  • QHtmlAttributeManager
  • QHtmlAttributeManagerBase
  • QHtmlReporter
  • QHtmlTable
  • QHtmlTable_CodeGenerator
  • QHtmlTableBase
  • QHtmlTableCallableColumn
  • QHtmlTableCheckBoxColumn
  • QHtmlTableCheckBoxColumn_ClickEvent
  • QHtmlTableIndexedColumn
  • QHtmlTableLinkColumn
  • QHtmlTableNodeColumn
  • QHtmlTablePropertyColumn
  • QI18n
  • QI18nTests
  • QImageBase
  • QImageBrowser
  • QImageBrowserBase
  • QImageBrowserNav
  • QImageBrowserThumbnails
  • QImageButton
  • QImageControl
  • QImageControlBase
  • QImageFileAsset
  • QImageLabel
  • QImageLabelBase
  • QImageRollover
  • QImageType
  • QIndex
  • QInformixPdoDatabase
  • QInformixPdoDatabaseField
  • QInformixPdoDatabaseResult
  • QInformixPdoDatabaseRow
  • QInputEvent
  • QInstallationValidationResult
  • QInstallationValidator
  • QIntegerTextBox
  • QIntegerTextBox_CodeGenerator
  • QIntegerTextBoxBase_CodeGenerator
  • QJavaScriptAction
  • QJQAction
  • QJQBounceAction
  • QJqButton
  • QJqButton_CreateEvent
  • QJqButtonBase
  • QJqButtonGen
  • QJqCheckBox
  • QJqCheckBox_CreateEvent
  • QJqCheckBoxBase
  • QJqCheckBoxGen
  • QJQHideAction
  • QJQHideEffectAction
  • QJQHighlightAction
  • QJQPulsateAction
  • QJqRadioButton
  • QJqRadioButton_CreateEvent
  • QJqRadioButtonBase
  • QJqRadioButtonGen
  • QJQShakeAction
  • QJQShowAction
  • QJQShowEffectAction
  • QJQSizeAction
  • QJQToggleAction
  • QJQToggleEffectAction
  • QJQTransferAction
  • QJqUiEvent
  • QJqUiPropertyEvent
  • QJsClosure
  • QJsFunction
  • QJsNoQuoteKey
  • QJsParameterList
  • QJsPriority
  • QJsTimer
  • QJsTimerBase
  • QJsVarName
  • QKeyDownEvent
  • QKeyPressEvent
  • QKeyUpEvent
  • QLabel
  • QLabel_CodeGenerator
  • QLabelBase_CodeGenerator
  • QLexer
  • QLinkButton
  • QListBox
  • QListBox_CodeGenerator
  • QListBoxBase
  • QListBoxBase_CodeGenerator
  • QListControl
  • QListControl_CodeGenerator
  • QListControlBase_CodeGenerator
  • QListItem
  • QListItemBase
  • QListItemStyle
  • QManyToManyReference
  • QMenu
  • QMenu_BlurEvent
  • QMenu_CreateEvent
  • QMenu_FocusEvent
  • QMenu_SelectEvent
  • QMenuBase
  • QMenuGen
  • QMimeType
  • QModelConnectorArgumentType
  • QModelConnectorCreateType
  • QModelConnectorEditDlg
  • QModelConnectorOptions
  • QModelConnectorParam
  • QMouseDownEvent
  • QMouseEnterEvent
  • QMouseLeaveEvent
  • QMouseMoveEvent
  • QMouseOutEvent
  • QMouseOverEvent
  • QMouseUpEvent
  • QMultiLevelCacheProvider
  • QMySqlDatabase
  • QMySqlDatabaseField
  • QMySqlDatabaseResult
  • QMySqli5ClusterDatabase
  • QMySqli5Database
  • QMySqli5DatabaseField
  • QMySqli5DatabaseResult
  • QMySqliDatabase
  • QMySqliDatabaseField
  • QMySqliDatabaseResult
  • QMySqliDatabaseRow
  • QNoScriptAjaxAction
  • QNumericTextBox
  • QOnEvent
  • QOracleDatabase
  • QOracleDatabaseField
  • QOracleDatabaseResult
  • QOracleDatabaseRow
  • QOrderedListType
  • QOverflow
  • QPaginatedControl
  • QPaginator
  • QPaginatorBase
  • QPanel
  • QPartialQueryBuilder
  • QPdoDatabase
  • QPdoDatabaseResult
  • QPgConditionILike
  • QPgConditionJsonContains
  • QPgQ
  • QPosition
  • QPostgreSqlDatabase
  • QPostgreSqlDatabaseField
  • QPostgreSqlDatabaseResult
  • QPostgreSqlDatabaseRow
  • QPostgreSqlPdoDatabase
  • QPostgreSqlPdoDatabaseField
  • QPostgreSqlPdoDatabaseResult
  • QPostgreSqlPdoDatabaseRow
  • QProgressbar
  • QProgressbar_ChangeEvent
  • QProgressbar_CompleteEvent
  • QProgressbar_CreateEvent
  • QProgressbarBase
  • QProgressbarGen
  • QQ
  • QQAggregationClause
  • QQAliasTests
  • QQAssociationNode
  • QQAverage
  • QQClause
  • QQColumnNode
  • QQCondition
  • QQConditionAll
  • QQConditionAnd
  • QQConditionBetween
  • QQConditionComparison
  • QQConditionEqual
  • QQConditionExists
  • QQConditionGreaterOrEqual
  • QQConditionGreaterThan
  • QQConditionIn
  • QQConditionIsNotNull
  • QQConditionIsNull
  • QQConditionLessOrEqual
  • QQConditionLessThan
  • QQConditionLike
  • QQConditionLogical
  • QQConditionNone
  • QQConditionNot
  • QQConditionNotBetween
  • QQConditionNotEqual
  • QQConditionNotExists
  • QQConditionNotIn
  • QQConditionNotLike
  • QQConditionOr
  • QQCount
  • QQDistinct
  • QQExpand
  • QQExpandAsArray
  • QQExpandVirtualNode
  • QQFuncTests
  • QQFunctionNode
  • QQGroupBy
  • QQHavingClause
  • QQLimitInfo
  • QQMathNode
  • QQMathOpTests
  • QQMaximum
  • QQMinimum
  • QQNamedValue
  • QQNode
  • QQNoParentNode
  • QQOrderBy
  • QQReverseReferenceNode
  • QQSelect
  • QQSubQueryCountNode
  • QQSubQueryNode
  • QQSubQuerySqlNode
  • QQSum
  • QQTableNode
  • QQuery
  • QQueryBuilder
  • QQueryExpansion
  • QQVirtualNode
  • QRadioButton
  • QRadioButtonList
  • QRadioButtonList_CodeGenerator
  • QRadioButtonListBase_CodeGenerator
  • QRedirectAction
  • QReference
  • QRegex
  • QRegisterClickPositionAction
  • QRepeatDirection
  • QRequestMode
  • QResetTimerAction
  • QResizable
  • QResizable_CreateEvent
  • QResizable_ResizeEvent
  • QResizable_StartEvent
  • QResizable_StopEvent
  • QResizableBase
  • QResizableGen
  • QResizeHandleDirection
  • QRestServiceCodeGen
  • QReverseReference
  • QRssCategory
  • QRssFeed
  • QRssImage
  • QRssItem
  • QSampleControl
  • QSampleTranslation
  • QSelectable
  • QSelectable_CreateEvent
  • QSelectable_SelectedEvent
  • QSelectable_SelectingEvent
  • QSelectable_StartEvent
  • QSelectable_StopEvent
  • QSelectable_UnselectedEvent
  • QSelectable_UnselectingEvent
  • QSelectableBase
  • QSelectableGen
  • QSelectControlAction
  • QSelectEvent
  • QSelectionMode
  • QSelectMenu
  • QSelectMenu_ChangeEvent
  • QSelectMenu_CloseEvent
  • QSelectMenu_CreateEvent
  • QSelectMenu_FocusEvent
  • QSelectMenu_OpenEvent
  • QSelectMenu_SelectEvent
  • QSelectMenuBase
  • QSelectMenuGen
  • QServerAction
  • QServerControlAction
  • QSessionFormStateHandler
  • QSetValueAction
  • QShowCalendarAction
  • QShowDialog
  • QShowDialogBox
  • QSlider
  • QSlider_ChangeEvent
  • QSlider_CodeGenerator
  • QSlider_CreateEvent
  • QSlider_SlideEvent
  • QSlider_StartEvent
  • QSlider_StopEvent
  • QSliderBase
  • QSliderBase_CodeGenerator
  • QSliderGen
  • QSoapMethod
  • QSoapParameter
  • QSoapService
  • QSortable
  • QSortable_ActivateEvent
  • QSortable_BeforeStopEvent
  • QSortable_ChangeEvent
  • QSortable_CreateEvent
  • QSortable_DeactivateEvent
  • QSortable_OutEvent
  • QSortable_OverEvent
  • QSortable_ReceiveEvent
  • QSortable_RemoveEvent
  • QSortable_SortEvent
  • QSortable_StartEvent
  • QSortable_StopEvent
  • QSortable_UpdateEvent
  • QSortableBase
  • QSortableGen
  • QSpinner
  • QSpinner_ChangeEvent
  • QSpinner_CreateEvent
  • QSpinner_SpinEvent
  • QSpinner_StartEvent
  • QSpinner_StopEvent
  • QSpinnerBase
  • QSpinnerGen
  • QSqlColumn
  • QSqLite3PdoDatabase
  • QSqLite3PdoDatabaseField
  • QSqLite3PdoDatabaseResult
  • QSqLite3PdoDatabaseRow
  • QSqlServer2005Database
  • QSqlServer2005DatabaseField
  • QSqlServer2005DatabaseResult
  • QSqlServer2005DatabaseRow
  • QSqlServerDatabase
  • QSqlServerDatabaseField
  • QSqlServerDatabaseResult
  • QSqlServerDatabaseRow
  • QSqlTable
  • QStack
  • QStopPropagationAction
  • QString
  • QStringTest
  • QTabKeyEvent
  • QTabs
  • QTabs_ActivateEvent
  • QTabs_BeforeActivateEvent
  • QTabs_BeforeLoadEvent
  • QTabs_CreateEvent
  • QTabs_LoadEvent
  • QTabsBase
  • QTabsGen
  • QTag
  • QTagStyler
  • QTerminateAction
  • QTestControl
  • QTestForm
  • QTextAlign
  • QTextBox
  • QTextBox_CodeGenerator
  • QTextBoxBase
  • QTextBoxBase_CodeGenerator
  • QTextMode
  • QTimer
  • QTimerExpiredEvent
  • QTimerTests
  • QToggleCssClassAction
  • QToggleDisplayAction
  • QToggleEnableAction
  • QTranslationPoParser
  • QTreeNav
  • QTreeNavItem
  • QType
  • QTypeTable
  • QTypeTests
  • QUnitTestCaseBase
  • QUnorderedListStyle
  • QUpArrowKeyEvent
  • QUrlTextBox
  • QVerticalAlign
  • QVirtualAttributeColumn
  • QWaitIcon
  • QWatcher
  • QWatcherBase
  • QWatcherCache
  • QWatcherDB
  • QWatcherNone
  • QWriteBox
  • RecordsSummary
  • RefreshForm
  • SampleComposite
  • SampleForm
  • SelectableLabel
  • SelectForm
  • SpeedForm
  • TestImageBrowser
  • UrlForm

Interfaces

  • ICacheAction
  • QDataList_CodeGenerator_Interface
  • QTranslationBase

Traits

  • QDataBinder
  • QListItemManager
  • QModelTrait

Exceptions

  • QCallerException
  • QCrossScriptingException
  • QCryptographyException
  • QDatabaseExceptionBase
  • QDataBindException
  • QDateTimeNullException
  • QEmailException
  • QIndexOutOfRangeException
  • QInformixPdoDatabaseException
  • QInvalidCastException
  • QInvalidFormStateException
  • QMySqliDatabaseException
  • QOptimisticLockingException
  • QOracleDatabaseException
  • QPdoDatabaseException
  • QPoParserException
  • QPostgreSqlDatabaseException
  • QPostgreSqlPdoDatabaseException
  • QRemoteAdminDeniedException
  • QSqLite3PdoDatabaseException
  • QSqlServer2005DatabaseException
  • QSqlServerDatabaseException
  • QUndefinedMethodException
  • QUndefinedPrimaryKeyException
  • QUndefinedPropertyException

Functions

  • __database_check_error
  • __QForm_EvaluateTemplate_ObHandler
  • _b
  • _indent
  • _nl
  • _p
  • _r
  • _t
  • _tp
  • _tr
  • array_trim
  • beginsWith
  • CamelCaseFromDash
  • CastToInt
  • DataGridEvalHandleError
  • DisplayMonospacedText
  • endsWith
  • GO_BACK
  • jq_anytime_gen
  • jq_control_gen
  • jq_inc_gen
  • jq_indent
  • PrintExplainStatement
  • PrintInstructions
  • QcubedHandleCodeGenParseError
  • QcubedHandleError
  • QcubedHandleException
  • QCubedShutdown
  • QDateTimeErrorHandler
  • trimOffEnd
  • trimOffFront
  • Overview
  • Package
  • Class
  1: <?php
  2:     /**
  3:      * This EmailServer (and its dependent EmailMessage class) allows the application to send
  4:      * messages via any accessible SMTP server.
  5:      * 
  6:      * The QEmailServer class, specifically, is an abstract class and is NOT meant to be instantiated.
  7:      * It has one public static method, Send, which takes in a QEmailMessage object.
  8:      */
  9:     abstract class QEmailServer extends QBaseClass {
 10:         /**
 11:          * Server Hostname or IP Address of the server running the SMTP service.
 12:          * Using an IP address is slightly faster, but using a Hostname is easier to manage.
 13:          * Defaults to "localhost".
 14:          *
 15:          * @var string SmtpServer
 16:          */
 17:         public static $SmtpServer = 'localhost';
 18: 
 19:         /**
 20:          * Port of the SMTP Service on the SmtpServer, usually 25
 21:          *
 22:          * @var integer SmtpPort
 23:          */
 24:         public static $SmtpPort = 25;
 25: 
 26:         /**
 27:          * IP Address of the Originating Server (e.g. the IP address of this server)
 28:          * used for the EHLO command in the SMTP protocol.  Defaults to the
 29:          * QApplication::$ServerAddress variable, which uses the PHP $_SERVER
 30:          * constants to determine the correct IP address.
 31:          *
 32:          * @var string OriginatingServerIp
 33:          */
 34:         public static $OriginatingServerIp;
 35: 
 36:         /**
 37:          * Whether or not we are running in Test Mode.  Test Mode allows you
 38:          * to develop e-mail-based applications without actually having access to
 39:          * an SMTP server or the Internet.  Instead of messages being sent out,
 40:          * the messages and corresponding SMTP communication will be saved to disk.
 41:          *
 42:          * @var boolean $TestMode
 43:          */
 44:         public static $TestMode = false;
 45: 
 46:         /**
 47:          * The directory where TestMode e-mail files will be saved to.  The process
 48:          * running the webserver *must* have write access to this directory.  Default
 49:          * is "/tmp", which makes sense in unix/linux/mac environments.  Windows users
 50:          * will likely need to set up their own temp directories.
 51:          *
 52:          * @var string $TestModeDirectory
 53:          */     
 54:         public static $TestModeDirectory = __TMP__;
 55: 
 56:         /**
 57:          * Boolean flag signifying whether SMTP's AUTH PLAIN should be used
 58:          * 
 59:          * @var bool $AuthPlain
 60:          */
 61:         public static $AuthPlain = false;
 62: 
 63:         /**
 64:          * Boolean flag signifying whether SMTP's AUTH LOGIN should be used
 65:          * 
 66:          * @var bool $AuthLogin
 67:          */
 68:         public static $AuthLogin = false;
 69: 
 70:         /**
 71:          * SMTP Username to use for AUTH PLAIN or LOGIN
 72:          * 
 73:          * @var string $SmtpUsername
 74:          */
 75:         public static $SmtpUsername = '';
 76: 
 77:         /**
 78:          * SMTP Password to use for AUTH PLAIN or LOGIN
 79:          * 
 80:          * @var string $SmtpPassword
 81:          */
 82:         public static $SmtpPassword = '';
 83: 
 84:         /**
 85:          * Encoding Type (if null, will default to the QApplication::$EncodingType)
 86:          * 
 87:          * @var string $EncodingType
 88:          */
 89:         public static $EncodingType = null;
 90: 
 91:         /**
 92:          * Uses regular expression matching to return an array of valid e-mail addresses
 93:          *
 94:          * @param string $strAddresses Single string containing e-mail addresses and anything else
 95:          * @return string[] An array of e-mail addresses only, or NULL if none
 96:          */
 97:         public static function GetEmailAddresses($strAddresses) {
 98:             $strAddressArray = null;
 99: 
100:             // Address Lines cannot have any linebreaks
101:             if ((strpos($strAddresses, "\r") !== false) ||
102:                 (strpos($strAddresses, "\n") !== false))
103:                 return null;
104: 
105:             preg_match_all ("/[a-zA-Z0-9_.'%+-]+[@][\-a-zA-Z0-9_.]+/", $strAddresses, $strAddressArray);
106:             if ((is_array($strAddressArray)) &&
107:                 (array_key_exists(0, $strAddressArray)) &&
108:                 (is_array($strAddressArray[0])) &&
109:                 (array_key_exists(0, $strAddressArray[0]))) {
110:                 return $strAddressArray[0];
111:             }
112:             
113:             // If we're here, then no addresses were found in $strAddress
114:             // so return null
115:             return null;
116:         }
117: 
118:         /**
119:          * This will check to see if an email address is considered "Valid" according to RFC 2822.
120:          * It utilizes the GetEmailAddresses static method, which does the actual logic work of checking.
121:          * @param string $strEmailAddress
122:          * @return boolean
123:          */
124:         public static function IsEmailValid($strEmailAddress) {
125:             $strEmailAddressArray = QEmailServer::GetEmailAddresses($strEmailAddress);
126:             return ((count($strEmailAddressArray) == 1) && ($strEmailAddressArray[0] == $strEmailAddress));  
127:         }
128: 
129:         /**
130:          * Encodes given 8 bit string to a quoted-printable string,
131:          * @param string $strString
132:          * @param boolean $blnSubject
133:          * @return encoded string
134:          */
135:         private static function QuotedPrintableEncode($strString, $blnSubject = false) {
136:             if ( function_exists('quoted_printable_encode') )
137:                 $strText = quoted_printable_encode($strString);
138:             else {
139:                 $strText = preg_replace( '/[^\x21-\x3C\x3E-\x7E\x09\x20]/e', 'sprintf( "=%02X", ord ( "$0" ) ) ;', $strString );
140:                 preg_match_all( '/.{1,73}([^=]{0,2})?/', $strText, $arrMatch );
141:                 $strText = implode( '=' . "\r\n", $arrMatch[0] );
142:             }
143:             
144:             if ($blnSubject) {
145:                 // Replace spaces with undercores, see RFC 1342
146:                 $strText = str_replace("_", "=5F", $strText);
147:                 $strText = str_replace(" ", "_", $strText);
148: 
149:                 // Remove newlines
150:                 $strText = str_replace("=\r\n", "", $strText);
151:             } else {
152:                 // Escape leading dots with another dot
153:                 $strText = str_replace("\n.", "\n..", $strText);
154:             }
155:             
156:             return $strText;
157:         }
158: 
159: 
160:         /**
161:          * Sends a message out via SMTP according to the server, ip, etc. preferences
162:          * as set up on the class.  Takes in a QEmailMessage object.
163:          * Will throw a QEmailException exception on any error.
164:          *
165:          * @param QEmailMessage $objMessage Message to Send
166:          *
167:          * @throws QEmailException
168:          * @return void
169:          */
170:         public static function Send(QEmailMessage $objMessage) {
171:             $objResource = null;
172: 
173:             if (QEmailServer::$TestMode) {
174:                 // Open up a File Resource to the TestModeDirectory
175:                 $strArray = explode(' ', microtime());
176:                 $strFileName = sprintf('%s/email_%s%s.txt', QEmailServer::$TestModeDirectory, $strArray[1], substr($strArray[0], 1));
177:                 $objResource = fopen($strFileName, 'w');
178:                 if (!$objResource)
179:                     throw new QEmailException(sprintf('Unable to open Test SMTP connection to: %s', $strFileName));
180: 
181:                 // Clear the Read Buffer
182:                 if (!feof($objResource))
183:                     fgets($objResource, 4096);
184: 
185:                 // Write the Connection Command
186:                 fwrite($objResource, sprintf("telnet %s %s\r\n", QEmailServer::$SmtpServer, QEmailServer::$SmtpPort));
187:             } else {
188:                 $objResource = fsockopen(QEmailServer::$SmtpServer, QEmailServer::$SmtpPort);
189:                 if (!$objResource)
190:                     throw new QEmailException(sprintf('Unable to open SMTP connection to: %s %s', QEmailServer::$SmtpServer, QEmailServer::$SmtpPort));
191:             }
192: 
193:             // Connect
194:             $strResponse = null;
195:             if (!feof($objResource)) {
196:                 $strResponse = fgets($objResource, 4096);
197: 
198:                 // Iterate through all "220-" responses (stop at "220 ")
199:                 while ((substr($strResponse, 0, 3) == "220") && (substr($strResponse, 0, 4) != "220 "))
200:                     if (!feof($objResource))
201:                         $strResponse = fgets($objResource, 4096);
202: 
203:                 // Check for a "220" response
204:                 if (!QEmailServer::$TestMode)
205:                     if ((strpos($strResponse, "220") === false) || (strpos($strResponse, "220") != 0))
206:                         throw new QEmailException(sprintf('Error Response on Connect: %s', $strResponse));
207:             }
208: 
209:             // Send: EHLO
210:             fwrite($objResource, sprintf("EHLO %s\r\n", QEmailServer::$OriginatingServerIp));
211:             if (!feof($objResource)) {
212:                 $strResponse = fgets($objResource, 4096);
213: 
214:                 // Iterate through all "250-" responses (stop at "250 ")
215:                 while ((substr($strResponse, 0, 3) == "250") && (substr($strResponse, 0, 4) != "250 "))
216:                     if (!feof($objResource))
217:                         $strResponse = fgets($objResource, 4096);
218: 
219:                 // Check for a "250" response
220:                 if (!QEmailServer::$TestMode)
221:                     if ((strpos($strResponse, "250") === false) || (strpos($strResponse, "250") != 0))
222:                         throw new QEmailException(sprintf('Error Response on EHLO: %s', $strResponse));
223:             }
224: 
225:             // Send Authentication
226:             if (QEmailServer::$AuthPlain) {
227:                 fwrite($objResource, "AUTH PLAIN " . base64_encode(QEmailServer::$SmtpUsername . "\0" . QEmailServer::$SmtpUsername . "\0" . QEmailServer::$SmtpPassword) . "\r\n");
228:                 if (!feof($objResource)) {
229:                     $strResponse = fgets($objResource, 4096);
230:                     if ((strpos($strResponse, "235") === false) || (strpos($strResponse, "235") != 0))
231:                         throw new QEmailException(sprintf('Error in response from AUTH PLAIN: %s', $strResponse));
232:                 }
233:             }
234: 
235:             if (QEmailServer::$AuthLogin) {
236:                 fwrite($objResource,"AUTH LOGIN\r\n");
237:                 if (!feof($objResource)) {
238:                     $strResponse = fgets($objResource, 4096);
239:                     if (!QEmailServer::$TestMode)
240:                         if ((strpos($strResponse, "334") === false) || (strpos($strResponse, "334") != 0))
241:                             throw new QEmailException(sprintf('Error in response from AUTH LOGIN: %s', $strResponse));
242:                 }
243: 
244:                 fwrite($objResource, base64_encode(QEmailServer::$SmtpUsername) . "\r\n");
245:                 if (!feof($objResource)) {
246:                     $strResponse = fgets($objResource, 4096);
247:                     if (!QEmailServer::$TestMode)
248:                         if ((strpos($strResponse, "334") === false) || (strpos($strResponse, "334") != 0))
249:                             throw new QEmailException(sprintf('Error in response from AUTH LOGIN: %s', $strResponse));
250:                 }
251: 
252:                 fwrite($objResource, base64_encode(QEmailServer::$SmtpPassword) . "\r\n");
253:                 if (!feof($objResource)) {
254:                     $strResponse = fgets($objResource, 4096);
255:                     if (!QEmailServer::$TestMode)
256:                         if ((strpos($strResponse, "235") === false) || (strpos($strResponse, "235") != 0))
257:                             throw new QEmailException(sprintf('Error in response from AUTH LOGIN: %s', $strResponse));
258:                 }
259:             }
260: 
261:             // Setup MAIL FROM line
262:             $strAddressArray = QEmailServer::GetEmailAddresses($objMessage->From);
263:             if (count($strAddressArray) != 1)
264:                 throw new QEmailException(sprintf('Not a valid From address: %s', $objMessage->From));
265: 
266:             // Send: MAIL FROM line
267:             fwrite($objResource, sprintf("MAIL FROM: <%s>\r\n", $strAddressArray[0]));          
268:             if (!feof($objResource)) {
269:                 $strResponse = fgets($objResource, 4096);
270:                 
271:                 // Check for a "250" response
272:                 if (!QEmailServer::$TestMode)
273:                     if ((strpos($strResponse, "250") === false) || (strpos($strResponse, "250") != 0))
274:                         throw new QEmailException(sprintf('Error Response on MAIL FROM: %s', $strResponse));
275:             }
276: 
277:             // Setup RCPT TO line(s)
278:             $strAddressToArray = QEmailServer::GetEmailAddresses($objMessage->To);
279:             if (!$strAddressToArray)
280:                 throw new QEmailException(sprintf('Not a valid To address: %s', $objMessage->To));
281: 
282:             $strAddressCcArray = QEmailServer::GetEmailAddresses($objMessage->Cc);
283:             if (!$strAddressCcArray)
284:                 $strAddressCcArray = array();
285: 
286:             $strAddressBccArray = QEmailServer::GetEmailAddresses($objMessage->Bcc);
287:             if (!$strAddressBccArray)
288:                 $strAddressBccArray = array();
289: 
290:             $strAddressCcBccArray = array_merge($strAddressCcArray, $strAddressBccArray);
291:             $strAddressArray = array_merge($strAddressToArray, $strAddressCcBccArray);
292: 
293:             // Send: RCPT TO line(s)
294:             foreach ($strAddressArray as $strAddress) {
295:                 fwrite($objResource, sprintf("RCPT TO: <%s>\r\n", $strAddress));
296:                 if (!feof($objResource)) {
297:                     $strResponse = fgets($objResource, 4096);
298:                     
299:                     // Check for a "250" response
300:                     if (!QEmailServer::$TestMode)
301:                         if ((strpos($strResponse, "250") === false) || (strpos($strResponse, "250") != 0))
302:                             throw new QEmailException(sprintf('Error Response on RCPT TO: %s', $strResponse));
303:                 }
304:             }
305: 
306:             // Send: DATA
307:             fwrite($objResource, "DATA\r\n");
308:             if (!feof($objResource)) {
309:                 $strResponse = fgets($objResource, 4096);
310:                 
311:                 // Check for a "354" response
312:                 if (!QEmailServer::$TestMode)
313:                     if ((strpos($strResponse, "354") === false) || (strpos($strResponse, "354") != 0))
314:                         throw new QEmailException(sprintf('Error Response on DATA: %s', $strResponse));
315:             }
316: 
317:             // Send: Required Headers
318:             fwrite($objResource, sprintf("Date: %s\r\n", QDateTime::NowToString(QDateTime::FormatRfc5322)));
319:             fwrite($objResource, sprintf("To: %s\r\n", $objMessage->To));
320:             fwrite($objResource, sprintf("From: %s\r\n", $objMessage->From));
321:             if($objMessage->ReplyTo) {
322:                 fwrite($objResource, sprintf("Reply-To: %s\r\n", $objMessage->ReplyTo));
323:             }
324:             if($objMessage->Sender) {
325:                 fwrite($objResource, sprintf("Sender: %s\r\n", $objMessage->Sender));
326:             }
327:             
328:             // Setup Encoding Type (use QEmailServer if specified, otherwise default to QApplication's)
329:             if (!($strEncodingType = QEmailServer::$EncodingType))
330:                 $strEncodingType = QApplication::$EncodingType;
331: 
332:             // Send: Optional Headers
333:             if ($objMessage->Subject) {
334:                 if ($objMessage->EncodeSubject) {
335:                     fwrite($objResource, sprintf("Subject: =?%s?Q?%s?=\r\n", $strEncodingType, self::QuotedPrintableEncode($objMessage->Subject, true)));
336:                 } else {
337:                     fwrite($objResource, sprintf("Subject: %s\r\n", $objMessage->Subject));
338:                 }
339:             }
340: 
341:             if ($objMessage->Cc)
342:                 fwrite($objResource, sprintf("Cc: %s\r\n", $objMessage->Cc));
343: 
344:             // Send: Content-Type Header (if applicable)
345: 
346:             // First, setup boundaries (may be needed if multipart)
347:             $strBoundary = sprintf('qcubed_mixed_boundary_%s', md5(microtime()));
348:             $strAltBoundary = sprintf('qcubed_alt_boundary_%s', md5(microtime()));
349: 
350:             // Send: Other Headers (if any)
351:             foreach ($objArray = $objMessage->HeaderArray as $strKey => $strValue)
352:                 fwrite($objResource, sprintf("%s: %s\r\n", $strKey, $strValue));            
353: 
354:             // if we are adding an html or files to the message we need these headers.
355:             if ($objMessage->HasFiles || $objMessage->HtmlBody)  {
356:                 fwrite($objResource, "MIME-Version: 1.0\r\n");
357:                 fwrite($objResource, sprintf("Content-Type: multipart/mixed;\r\n boundary=\"%s\"\r\n", $strBoundary));
358:                 fwrite($objResource, sprintf("This is a multipart message in MIME format.\r\n\r\n", $strBoundary));
359:                 fwrite($objResource, sprintf("--%s\r\n", $strBoundary));                
360:             }
361: 
362:             // Send: Body
363:             if ($objMessage->HtmlBody) {
364:                 fwrite($objResource, sprintf("Content-Type: multipart/alternative;\r\n boundary=\"%s\"\r\n\r\n", $strAltBoundary));
365:                 fwrite($objResource, sprintf("--%s\r\n", $strAltBoundary));
366:                 fwrite($objResource, sprintf("Content-Type: text/plain; charset=\"%s\"\r\n", $strEncodingType));
367:                 fwrite($objResource, sprintf("Content-Transfer-Encoding: quoted-printable\r\n\r\n"));
368: 
369:                 fwrite($objResource, self::QuotedPrintableEncode($objMessage->Body));
370:                 fwrite($objResource, "\r\n\r\n");
371: 
372:                 fwrite($objResource, sprintf("--%s\r\n", $strAltBoundary));
373:                 fwrite($objResource, sprintf("Content-Type: text/html; charset=\"%s\"\r\n", $strEncodingType));
374:                 fwrite($objResource, sprintf("Content-Transfer-Encoding: quoted-printable\r\n\r\n"));                               
375:         
376:                 fwrite($objResource, self::QuotedPrintableEncode($objMessage->HtmlBody));
377:                 fwrite($objResource, "\r\n\r\n");
378:                 
379:                 fwrite($objResource, sprintf("--%s--\r\n", $strAltBoundary));
380:             } else if($objMessage->HasFiles) {
381:                 fwrite($objResource, sprintf("Content-Type: multipart/alternative;\r\n boundary=\"%s\"\r\n\r\n", $strAltBoundary));             
382:                 fwrite($objResource, sprintf("--%s\r\n", $strAltBoundary));
383:                 fwrite($objResource, sprintf("Content-Type: text/plain; charset=\"%s\"\r\n", $strEncodingType));
384:                 fwrite($objResource, sprintf("Content-Transfer-Encoding: quoted-printable\r\n\r\n"));
385:                 fwrite($objResource, self::QuotedPrintableEncode($objMessage->Body));
386:                 fwrite($objResource, "\r\n\r\n");
387:                 fwrite($objResource, sprintf("--%s--\r\n", $strAltBoundary));
388:             } else {
389:                 fwrite($objResource, sprintf("Content-Type: text/plain; charset=\"%s\"\r\n", $strEncodingType));
390:                 fwrite($objResource, sprintf("Content-Transfer-Encoding: quoted-printable\r\n\r\n"));
391:                 fwrite($objResource, "\r\n" . self::QuotedPrintableEncode($objMessage->Body));
392:             }
393: 
394:             // Send: File Attachments
395:             if($objMessage->HasFiles) {
396:                 foreach ($objArray = $objMessage->FileArray as $objFile) {
397:                     fwrite($objResource, sprintf("--%s\r\n", $strBoundary));
398:                     fwrite($objResource, sprintf("Content-Type: %s;\r\n", $objFile->MimeType ));
399:                     fwrite($objResource, sprintf("    name=\"%s\"\r\n", $objFile->FileName ));
400:                     fwrite($objResource, "Content-Transfer-Encoding: base64\r\n");
401:                     fwrite($objResource, sprintf("Content-Length: %s\r\n", strlen($objFile->EncodedFileData)));
402:                     fwrite($objResource, "Content-Disposition: attachment;\r\n");
403:                     fwrite($objResource, sprintf("    filename=\"%s\"\r\n\r\n", $objFile->FileName));
404:                     fwrite($objResource, $objFile->EncodedFileData);
405: //                  foreach (explode("\r\n", $objFile->EncodedFileData) as $strLine) {
406: //                      $strLine = trim($strLine);
407: //                      fwrite($objResource, $strLine . "\r\n");
408: //                  }
409:                 }
410:             }
411: 
412:             // close a message with these boundaries if the message had files or had html
413:             if($objMessage->HasFiles || $objMessage->HtmlBody)
414:                 fwrite($objResource, sprintf("\r\n\r\n--%s--\r\n", $strBoundary)); // send end of file attachments...
415: 
416:             // Send: Message End
417:             fwrite($objResource, "\r\n.\r\n");
418:             if (!feof($objResource)) {
419:                 $strResponse = fgets($objResource, 4096);
420:                 
421:                 // Check for a "250" response
422:                 if (!QEmailServer::$TestMode)
423:                     if ((strpos($strResponse, "250") === false) || (strpos($strResponse, "250") != 0))
424:                         throw new QEmailException(sprintf('Error Response on DATA finish: %s', $strResponse));
425:             }
426: 
427:             // Send: QUIT
428:             fwrite($objResource, "QUIT\r\n");
429:             if (!feof($objResource))
430:                 $strResponse = fgets($objResource, 4096);
431:                 
432:             // Close the Resource
433:             fclose($objResource);
434:             if (QEmailServer::$TestMode)
435:                 chmod($strFileName, 0777);
436:         }
437:     }
438: 
439:     // PHP does not allow Static Class Variables to be set to non-constants.
440:     // So we set QEmailServer's OriginatingServerIp to QApplication's ServerAddress here.
441:     QEmailServer::$OriginatingServerIp = QApplication::$ServerAddress;
442: 
443:     class QEmailException extends QCallerException {}
444:     
445:     class QEmailAttachment extends QBaseClass {
446:         protected $strFilePath;
447:         protected $strMimeType;
448:         protected $strFileName;
449:         protected $strEncodedFileData;
450: 
451:         public function __construct($strFilePath, $strSpecifiedMimeType = null, $strSpecifiedFileName = null) {
452:             // Set File Path
453:             if (!is_file(realpath($strFilePath)))
454:                 throw new QCallerException('File Not Found: ' . $strFilePath);
455:             $this->strFilePath = realpath($strFilePath);
456: 
457: 
458:             // Set the File MIME Type -- if Explicitly Set, use it
459:             if ($strSpecifiedMimeType)
460:                 $this->strMimeType = $strSpecifiedMimeType;
461:             // otherwise, use QMimeType to determine
462:             else
463:                 $this->strMimeType = QMimeType::GetMimeTypeForFile($this->strFilePath);
464: 
465: 
466:             // Set the File Name -- if explicitly set, use it
467:             if ($strSpecifiedFileName)
468:                 $this->strFileName = $strSpecifiedFileName;
469:             // Otherwise, use basename() to determine
470:             else
471:                 $this->strFileName = basename($this->strFilePath);
472: 
473: 
474:             // Read file into a Base64 Encoded Data Stream
475:             $strFileContents = file_get_contents($this->strFilePath, false);
476:             $this->strEncodedFileData = chunk_split(base64_encode($strFileContents));
477:         }
478: 
479:         public function __get($strName) {
480:             switch ($strName) {
481:                 case 'FilePath': return $this->strFilePath;
482:                 case 'MimeType': return $this->strMimeType; 
483:                 case 'FileName': return $this->strFileName;
484:                 case 'EncodedFileData': return $this->strEncodedFileData;
485:                 default:
486:                     try {
487:                         return parent::__get($strName);
488:                     } catch (QCallerException $objExc) {
489:                         $objExc->IncrementOffset();
490:                         throw $objExc;
491:                     }
492:             }
493:         }
494:     }
495:     
496:     class QEmailStringAttachment extends QEmailAttachment {
497:         public function __construct($strContent, $strSpecifiedMimeType, $strSpecifiedFileName) {
498:             // Set the File MIME Type -- if Explicitly Set, use it
499:             if ($strSpecifiedMimeType) {
500:                 $this->strMimeType = $strSpecifiedMimeType;
501:             }
502:             
503:             // Set the File Name -- if explicitly set, use it
504:             if ($strSpecifiedFileName) {
505:                 $this->strFileName = $strSpecifiedFileName;
506:             }
507:             
508:             // Read file into a Base64 Encoded Data Stream
509:             $this->strEncodedFileData = chunk_split(base64_encode($strContent));
510:         }
511:     }
512: 
513:     /**
514:      * An email message that you can send with QEmailServer
515:      *
516:      * @property string $From
517:      * @property string $ReplyTo
518:      * @property string $Sender
519:      * @property string $To
520:      * @property string $Cc
521:      * @property string $Bcc
522:      * @property string $Subject
523:      * @property string $Body
524:      * @property string $HtmlBody
525:      * @property boolean $EncodeSubject  Whether to encode the subject of the email using UTF-8. Default is true. You might want to turn this off if sending to text message portals (i.e. 123-4567@sprint.message.com)
526:      */
527:     class QEmailMessage extends QBaseClass {
528:         protected $strFrom;
529:         protected $strReplyTo;
530:         protected $strSender;
531:         protected $strTo;
532:         protected $strSubject;
533:         protected $strBody;
534:         protected $strHtmlBody;
535: 
536:         protected $strCc;
537:         protected $strBcc;
538:         protected $strHeaderArray = array();
539:         protected $objFileArray = array();
540: 
541:         protected $blnEncodeSubject = true; // useful for sending to text message hubs, they don't like charset declaractions
542: 
543:         public function AddAttachment(QEmailAttachment $objFile) {                      
544:             $this->objFileArray[$objFile->FileName] = $objFile;
545:         }
546: 
547:         public function Attach($strFilePath, $strSpecifiedMimeType = null, $strSpecifiedFileName = null) {
548:             $this->AddAttachment(new QEmailAttachment($strFilePath, $strSpecifiedMimeType, $strSpecifiedFileName));
549:         }
550: 
551:         public function RemoveAttachment($strName) {
552:             if (array_key_exists($strName, $this->objFileArray))
553:                 unset($this->objFileArray[$strName]);
554:         }
555: 
556:         public function SetHeader($strName, $strValue) {
557:             $this->strHeaderArray[$strName] = $strValue;
558:         }
559: 
560:         public function GetHeader($strName) {
561:             if (array_key_exists($strName, $this->strHeaderArray))
562:                 return $this->strHeaderArray[$strName];
563:             return null;
564:         }
565: 
566:         public function RemoveHeader($strName) {
567:             if (array_key_exists($strName, $this->strHeaderArray))
568:                 unset($this->strHeaderArray[$strName]);
569:         }
570: 
571:         public function __construct($strFrom = null, $strTo = null, $strSubject = null, $strBody = null) {
572:             $this->strFrom = $strFrom;
573:             $this->strTo = $strTo;
574: 
575:             // We must cleanup the Subject and Body -- use the Property to set
576:             $this->Subject = $strSubject;
577:             $this->Body = $strBody;
578:         }
579: 
580:         public function __get($strName) {
581:             switch ($strName) {
582:                 case 'From'     : return $this->strFrom;
583:                 case 'ReplyTo'      : return $this->strReplyTo;
584:                 case 'Sender'       : return $this->strSender;
585:                 case 'To'       : return $this->strTo;
586:                 case 'Subject': return $this->strSubject;
587:                 case 'Body': return $this->strBody;
588:                 case 'HtmlBody': return $this->strHtmlBody;
589: 
590:                 case 'Cc': return $this->strCc;
591:                 case 'Bcc': return $this->strBcc;
592: 
593:                 case 'HeaderArray': return $this->strHeaderArray;
594:                 case 'FileArray': return $this->objFileArray;
595:                 case 'HasFiles': return (count($this->objFileArray) > 0) ? true : false;
596:                 case 'EncodeSubject': return $this->blnEncodeSubject;
597: 
598:                 default:
599:                     try {
600:                         return parent::__get($strName);
601:                     } catch (QCallerException $objExc) {
602:                         $objExc->IncrementOffset();
603:                         throw $objExc;
604:                     }
605:             }
606:         }
607: 
608:         public function __set($strName, $mixValue) {
609:             try {
610:                 switch ($strName) {
611:                     case 'From' : return ($this->strFrom = QType::Cast($mixValue, QType::String));
612:                     case 'ReplyTo'  : return ($this->strReplyTo = QType::Cast($mixValue, QType::String));
613:                     case 'Sender'   : return ($this->strSender = QType::Cast($mixValue, QType::String));
614:                     case 'To': return ($this->strTo = QType::Cast($mixValue, QType::String));
615:                     case 'Subject':
616:                         $strSubject = trim(QType::Cast($mixValue, QType::String));
617:                         $strSubject = str_replace("\r", "", $strSubject);
618:                         $strSubject = str_replace("\n", " ", $strSubject);
619:                         return ($this->strSubject = $strSubject);
620:                     case 'Body':
621:                         $strBody = QType::Cast($mixValue, QType::String);
622:                         $strBody = str_replace("\r", "", $strBody);
623:                         $strBody = str_replace("\n", "\r\n", $strBody);
624:                         $strBody = str_replace("\n.", "\n..", $strBody);
625:                         return ($this->strBody = $strBody);
626:                     case 'HtmlBody':
627:                         $strHtmlBody = QType::Cast($mixValue, QType::String);
628:                         $strHtmlBody = str_replace("\r", "", $strHtmlBody);
629:                         $strHtmlBody = str_replace("\n", "\r\n", $strHtmlBody);
630:                         $strHtmlBody = str_replace("\n.", "\n..", $strHtmlBody);
631:                         return ($this->strHtmlBody = $strHtmlBody);
632: 
633:                     case 'Cc': return ($this->strCc = QType::Cast($mixValue, QType::String));
634:                     case 'Bcc': return ($this->strBcc = QType::Cast($mixValue, QType::String));
635:                     case 'EncodeSubject': return ($this->blnEncodeSubject = QType::Cast($mixValue, QType::Boolean));
636: 
637:                     default: return (parent::__set($strName, $mixValue));
638:                 }
639:             } catch (QInvalidCastException $objExc) {
640:                 $objExc->IncrementOffset();
641:                 throw $objExc;
642:             }
643:         }
644:     }
API documentation generated by ApiGen