WebFioriAPI ReferenceLearnDownloadContributeLearn{{result.parent_page}} > {{result.title}}{{result.title}}Classes{{result.class_name}}{{result.summary}}Methods{{result.name}}{{result.summary}}

namespace \webfiori\framework\mail

class SMTPServer

Class Attributes Summary

const NL

Class Methods Summary

public function __construct(string$serverAddress, string$port)Initiates new instance of the class.public function authLogin(string$username, string$pass)Use plain authorization method to log in the user to SMTP server.public function connect()Connects to SMTP server.public function getHost()Returns SMTP server host address.public function getLastLogEntry()Returns an array that contains last log entry.public function getLastResponse()Returns the last response message which was sent by the server.public function getLastResponseCode()Returns last response code that was sent by SMTP server after executing specific command.public function getLastSentCommand()Returns the last command which was sent to SMTP server.public function getLog()Returns an array that contains log messages for different events or commands which was sent to the server.public function getPort()Returns SMTP server port number.public function getServerOptions()Returns an array that contains server supported commands.public function getTimeout()Returns the time at which the connection will timeout if no response was received in minutes.public function isConnected()Checks if the connection is still open or is it closed.public function isInWritingMode()Checks if the server is in message writing mode.public function read()Read server response after sending a command to the server.public function sendCommand(string$command)Sends a command to the mail server.public function sendHello()Sends 'EHLO' command to SMTP server.public function setTimeout(int$val)Sets the timeout time of the connection.

Class Attributes Details

const NL

Class Methods Details

public function __construct(string$serverAddress, string$port)Initiates new instance of the class.

Parameters:

  • string $serverAddress SMTP Server address such as 'smtp.example.com'.
  • string $port SMTP server port such as 25, 465 or 587.
public function authLogin(string$username, string$pass)Use plain authorization method to log in the user to SMTP server. This method will attempt to establish a connection to SMTP server if the method 'SMTPServer::connect()' is called.

Parameters:

  • string $username The username of SMTP server user.
  • string $pass The password of the user.
Returns: booleanIf the user is authenticated successfully, the method will return true. Other than that, the method will return false.
public function connect()Connects to SMTP server. Returns: booleanIf the connection was established and the 'EHLO' command was successfully sent, the method will return true. Other than that, the method will return false.public function getHost()Returns SMTP server host address. Returns: stringA string such as 'smtp.example.com'.public function getLastLogEntry()Returns an array that contains last log entry. Returns: arrayThe array will have 4 indices, 'command', 'code', 'message' and 'time'.public function getLastResponse()Returns the last response message which was sent by the server. Returns: stringThe last response message after executing some command. Default value is empty string.public function getLastResponseCode()Returns last response code that was sent by SMTP server after executing specific command. Returns: intThe last response code that was sent by SMTP server after executing specific command. Default return value is 0.public function getLastSentCommand()Returns the last command which was sent to SMTP server. Returns: stringThe last command which was sent to SMTP server.public function getLog()Returns an array that contains log messages for different events or commands which was sent to the server. Returns: arrayThe array will hold sub-associative arrays. Each array will have 4 indices, 'command', 'code', 'message' and 'time'public function getPort()Returns SMTP server port number. Returns: intCommon values are : 25, 465 (SSL) and 586 (TLS).public function getServerOptions()Returns an array that contains server supported commands. The method will only be able to get the options after sending the command 'EHLO' to the server. The array will be empty if not connected to SMTP server.Returns: arrayAn array that holds supported SMTP server options.public function getTimeout()Returns the time at which the connection will timeout if no response was received in minutes. Returns: intTimeout time in minutes.public function isConnected()Checks if the connection is still open or is it closed. Returns: booleantrue if the connection is open.public function isInWritingMode()Checks if the server is in message writing mode. The server will be in writing mode if the command 'DATA' was sent.Returns: booleanIf the server is in message writing mode, the method will return true. False otherwise.public function read()Read server response after sending a command to the server. Returns: string public function sendCommand(string$command)Sends a command to the mail server.

Parameters:

  • string $command Any SMTP command which is supported by the server.
Returns: booleanThe method will return always true if the command was sent. The only case that the method will return false is when it is not connected to the server.
public function sendHello()Sends 'EHLO' command to SMTP server. The developer does not have to call this method manually as its called when connecting to SMTP server.Returns: booleanIf the command was sent successfully, the method will return true. Other than that, the method will return false.public function setTimeout(int$val)Sets the timeout time of the connection.

Parameters:

  • int $val The value of timeout (in minutes). The timeout will be updated only if the connection is not yet established and the given value is grater than 0.
mdi-menuAll Classesmdi-chevron-leftAnchorBrCodeSnippetHTMLDocHTMLListHTMLNodeHTMLTableHeadNodeInputJsCodeLabelListItemOrderedListParagraphRadioGroupTableCellTableRowUnorderedListInvalidNodeNameExceptionTemplateNotFoundExceptionCaseConverterJsonJsonConverterJsonIJsonTypesPropertyAPIFilterAbstractWebServiceManagerInfoServiceParamTypesRequestRequestParameterResponseUriWebServicesManagerAccessAutoLoaderConfigConfigControllerDBEAbstractWebServiceExtendedWebServicesManagerFileLoggerPrivilegePrivilegesGroupThemeThemeLoaderUploadFileUploaderUserUtilWebFioriAppLanguageErrorBoxHTTPCodeViewMessageBoxServerErrViewStarterPageWebPageDatabaseSessionStorageDefaultSessionStorageMSSQLSessionDataTableMSSQLSessionsTableMySQLSessionDataTableMySQLSessionsTableSessionSessionOperationsSessionStorageSessionsManagerRouterRouterUriAbstractMiddlewareMiddlewareManagerEmailMessageSMTPAccountSMTPServerClassLoaderExceptionFileExceptionInitializationExceptionInvalidCRONExprExceptionMissingLangExceptionNoSuchThemeExceptionRoutingExceptionSMTPExceptionSessionExceptionUIExceptionAbstractJobCronCronEmailCronJobJobArgumentCronLoginViewCronTasksViewCronViewCronLoginServiceCronLogoutServiceCronServicesManagerForceCronExecutionServiceGetJobsServiceCLICLICommandInputStreamOutputStreamStdInStdOutClassWriterLangClassWriterQueryClassWriterServiceHolderThemeClassWriterWebServiceWriterCreateCLIClassHelperCreateCronJobCreateMiddlewareCreateTableCreateTableObjCreateThemeHelperCreateWebServiceAddCommandCreateCommandCronCommandHelpCommandListCronCommandListRoutesCommandListThemesCommandRunSQLQueryCommandSettingsCommandTestRouteCommandUpdateSettingsCommandUpdateTableCommandVersionCommandAbstractQueryColumnColumnFactoryConditionConnectionConnectionInfoDatabaseDatabaseExceptionDateTimeValidatorEntityMapperExpressionForeignKeyJoinTableResultSetSelectExpressionTableWhereExpressionMySQLColumnMySQLConnectionMySQLQueryMySQLTableMSSQLColumnMSSQLConnectionMSSQLQueryMSSQLTableAbstractCollectionComparableLinkedListNodeQueueStack
Powered By: WebFiori Framework, Vue and VuetifyAll Rights Reserved © 2018 - 2024