com.aspose.email

Interfaces

Classes

Enums

Exceptions

com.aspose.email

Class SmtpClient

    • Constructor Detail

      • SmtpClient

        public SmtpClient()

        Initializes a new instance of the SmtpClient class.

      • SmtpClient

        public SmtpClient(String host)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
      • SmtpClient

        public SmtpClient(String host,
                  short securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  int port)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  String password)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        password - The password.
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  String password,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        password - The password.
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  String password)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        password - The password.
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  String password,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        password - The password.
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  String authInfo,
                  boolean useOAuth)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        authInfo - The user password or XOAUTH2 access token
        useOAuth - Defines whether SASL XOAUTH2 mechanism is used to login to the server
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  String authInfo,
                  boolean useOAuth,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        authInfo - The user password or XOAUTH2 access token
        useOAuth - Defines whether SASL XOAUTH2 mechanism is used to login to the server
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  String authInfo,
                  boolean useOAuth)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        authInfo - The user password or XOAUTH2 access token
        useOAuth - Defines whether SASL XOAUTH2 mechanism is used to login to the server
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  String authInfo,
                  boolean useOAuth,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        authInfo - The user password or XOAUTH2 access token
        useOAuth - Defines whether SASL XOAUTH2 mechanism is used to login to the server
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  ITokenProvider tokenProvider)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        tokenProvider - TokenProvider allowing to retrieve access token.
      • SmtpClient

        public SmtpClient(String host,
                  String username,
                  ITokenProvider tokenProvider,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        username - The username.
        tokenProvider - TokenProvider allowing to retrieve access token.
        securityOptions - Security mode for a mail client
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  ITokenProvider tokenProvider)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        tokenProvider - TokenProvider allowing to retrieve access token.
      • SmtpClient

        public SmtpClient(String host,
                  int port,
                  String username,
                  ITokenProvider tokenProvider,
                  int securityOptions)

        Initializes a new instance of the SmtpClient class.

        Parameters:
        host - The name of the host used for SMTP.
        port - The port used for SMTP.
        username - The username.
        tokenProvider - TokenProvider allowing to retrieve access token.
        securityOptions - Security mode for a mail client
    • Method Detail

      • getHelloMessage

        public final String getHelloMessage()

        Gets or sets a HELO/EHLO string.

      • setHelloMessage

        public final void setHelloMessage(String value)

        Gets or sets a HELO/EHLO string.

      • getDeliveryMethod

        public final int getDeliveryMethod()

        Gets or sets the delivery method.

        Value: An SmtpDeliveryMethod that indicates how messages are delivered.
      • setDeliveryMethod

        public final void setDeliveryMethod(int value)

        Gets or sets the delivery method.

        Value: An SmtpDeliveryMethod that indicates how messages are delivered.
      • getPickupDirectoryLocation

        public final String getPickupDirectoryLocation()

        Gets or sets the directory where applications save mail messages to be processed by the local SMTP server. Please note: only absolute path is allowed.

        Value: A String that represents the pickup directory
      • setPickupDirectoryLocation

        public final void setPickupDirectoryLocation(String value)

        Gets or sets the directory where applications save mail messages to be processed by the local SMTP server. Please note: only absolute path is allowed.

        Value: A String that represents the pickup directory
      • getSmtpQueueLocation

        public final String getSmtpQueueLocation()

        Gets or sets the directory where applications save mail messages to be processed by sending in SMTP queue. Please note: only absolute path is allowed.

        Value: A String that represents the pickup directory
      • setSmtpQueueLocation

        public final void setSmtpQueueLocation(String value)

        Gets or sets the directory where applications save mail messages to be processed by sending in SMTP queue. Please note: only absolute path is allowed.

        Value: A String that represents the pickup directory
      • setFailedQueueSending

        public void setFailedQueueSending(com.aspose.ms.System.EventHandler<MailMessageEventArgs> handler)

        Adds or removes subscriber for notifications about failed sending operations in smtp queue

      • setSucceededQueueSending

        public void setSucceededQueueSending(com.aspose.ms.System.EventHandler<MailMessageEventArgs> handler)

        Adds or removes subscriber for notifications about succeeded sending operations in smtp queue

      • getEncoding

        @Deprecated
        public final Charset getEncoding()
        Deprecated. 

        Gets or sets the encoding.

        Value: The encoding.
      • setEncoding

        @Deprecated
        public final void setEncoding(Charset value)
        Deprecated. 

        Gets or sets the encoding.

        Value: The encoding.
      • getUseDefaultCredentials

        public boolean getUseDefaultCredentials()

        Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.

        Overrides:
        getUseDefaultCredentials in class EmailClient
      • setUseDefaultCredentials

        public void setUseDefaultCredentials(boolean value)

        Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.

        Overrides:
        setUseDefaultCredentials in class EmailClient
      • getUseTnef

        public final boolean getUseTnef()

        Gets or sets a boolean value that controls whether the messages are sent in TNEF format. Note, that now message is sent in TNEF format when being loaded a message contains tnef.

      • setUseTnef

        public final void setUseTnef(boolean value)

        Gets or sets a boolean value that controls whether the messages are sent in TNEF format. Note, that now message is sent in TNEF format when being loaded a message contains tnef.

      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     String recipient,
                                                     MailMessage message)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipient - Recipient of the forwarded message.
        message - The message for a forwarding.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     String recipient,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipient - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     String recipient,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback,
                                                     Object state)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipient - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     String recipient,
                                                     MailMessage message)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipient - Recipients of the forwarded message.
        message - The message for a forwarding.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     String recipient,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipient - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     String recipient,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback,
                                                     Object state)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipient - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(IConnection connection,
                                                     String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback,
                                                     Object state)

        Begins forward email asynchronously.

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginForward

        public final com.aspose.ms.System.IAsyncResult beginForward(String sender,
                                                     MailAddressCollection recipients,
                                                     MailMessage message,
                                                     com.aspose.ms.System.AsyncCallback callback,
                                                     Object state)

        Begins forward email asynchronously.

        Parameters:
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • endForward

        public final void endForward(com.aspose.ms.System.IAsyncResult asyncResult)

        Waits for the asynchronous operation to complete.

        Parameters:
        asyncResult - The reference to the pending asynchronous request to wait for.
      • forward

        public final void forward(IConnection connection,
                   String sender,
                   String recipient,
                   MailMessage message)

        Forwards specified message to recipient

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipient - Recipient of the forwarded message.
        message - The message for a forwarding.
      • forward

        public final void forward(IConnection connection,
                   String sender,
                   MailAddressCollection recipients,
                   MailMessage message)

        Forwards specified message to recipient

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
      • forward

        public final void forward(String sender,
                   String recipient,
                   MailMessage message)

        Forwards specified message to recipient

        Parameters:
        sender - Sender of the forwarded message.
        recipient - Recipient of the forwarded message.
        message - The message for a forwarding.
      • forward

        public final void forward(String sender,
                   MailAddressCollection recipients,
                   MailMessage message)

        Forwards specified message to recipient

        Parameters:
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        message - The message for a forwarding.
      • forward

        public final void forward(IConnection connection,
                   String sender,
                   MailAddressCollection recipients,
                   InputStream messageStream)

        Forwards specified message to recipient

        Parameters:
        connection - Connection to a server
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        messageStream - The stream that represents message in eml format.
      • forward

        public final void forward(String sender,
                   MailAddressCollection recipients,
                   InputStream messageStream)

        Forwards specified message to recipient

        Parameters:
        sender - Sender of the forwarded message.
        recipients - Recipients of the forwarded message.
        messageStream - The stream that represents message in eml format.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop(IConnection connection)

        Begins to execute 'No operation' command

        Parameters:
        connection - Connection to a server
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop(IConnection connection,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins to execute 'No operation' command

        Parameters:
        connection - Connection to a server
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop(IConnection connection,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins to execute 'No operation' command

        Parameters:
        connection - Connection to a server
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop()

        Begins to execute 'No operation' command

        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop(com.aspose.ms.System.AsyncCallback callback)

        Begins to execute 'No operation' command

        Parameters:
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginNoop

        public final com.aspose.ms.System.IAsyncResult beginNoop(com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins to execute 'No operation' command

        Parameters:
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • endNoop

        public final void endNoop(com.aspose.ms.System.IAsyncResult asyncResult)

        Waits for the pending asynchronous operation to complete.

        Parameters:
        asyncResult - The reference to the pending asynchronous request to wait for.
      • noop

        public void noop(IConnection connection)

        'No operation' command

        Specified by:
        noop in class EmailClient
        Parameters:
        connection - Connection to a server
      • noop

        public void noop()

        'No operation' command

        Specified by:
        noop in class EmailClient
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  MailMessage message)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        message - Represents an e-mail message
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  MailMessage message,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        message - Represents an e-mail message
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  MailMessage message,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        message - Represents an e-mail message
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  String from,
                                                  String recipients,
                                                  String subject,
                                                  String body)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  String from,
                                                  String recipients,
                                                  String subject,
                                                  String body,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  String from,
                                                  String recipients,
                                                  String subject,
                                                  String body,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  MailMessage... messages)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(MailMessage message)

        Begins sending email asynchronously.

        Parameters:
        message - Represents an e-mail message
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(MailMessage message,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        message - Represents an e-mail message
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(MailMessage message,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        message - Represents an e-mail message
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(String from,
                                                  String recipients,
                                                  String subject,
                                                  String body)

        Begins sending email asynchronously.

        Parameters:
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(String from,
                                                  String recipients,
                                                  String subject,
                                                  String body,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(String from,
                                                  String recipients,
                                                  String subject,
                                                  String body,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(MailMessage... messages)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(IConnection connection,
                                                  Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate,
                                                  com.aspose.ms.System.AsyncCallback callback)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSend

        public final com.aspose.ms.System.IAsyncResult beginSend(Iterable<MailMessage> messages,
                                                  com.aspose.ms.System.EventHandler<MailMessageEventArgs> messageSentDelegate,
                                                  com.aspose.ms.System.AsyncCallback callback,
                                                  Object state)

        Begins sending email asynchronously.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
        messageSentDelegate - References a method to be called when a message has been sent.
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • endSend

        public final void endSend(com.aspose.ms.System.IAsyncResult asyncResult)

        Waits for the asynchronous operation to complete.

        Parameters:
        asyncResult - The reference to the pending asynchronous request to wait for.
      • send

        public final void send(String from,
                String recipients,
                String subject,
                String body)

        Creates and sends the specified message.

        Parameters:
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
      • send

        public final void send(MailMessage message)

        Send the specified message.

        Specified by:
        send in interface IMailTransferAgent
        Parameters:
        message - The MailMessage that represents an email-message.
      • send

        public final void send(MailMessage... messages)

        Send the specified message.

        Parameters:
        messages - The array of MailMessage that represents an email-messages to send.
      • send

        public final void send(MailMessageCollection messages)

        Send the specified message collection.

        Parameters:
        messages - The collection of messages.
      • send

        public final void send(Iterable<MailMessage> messages)

        Send the specified messages.

        Parameters:
        messages - The IEnumerator that supports a message iteration.
      • send

        public final void send(IConnection connection,
                String from,
                String recipients,
                String subject,
                String body)

        Creates and sends the specified message.

        Parameters:
        connection - Connection to a server
        from - A String that contains the address of message sender.
        recipients - A String that contains the address of recipients.
        subject - A subject of message.
        body - A body of message.
      • send

        public final void send(IConnection connection,
                MailMessage message)

        Send the specified message.

        Parameters:
        connection - Connection to a server
        message - The MailMessage that represents an email-message.
      • send

        public final void send(IConnection connection,
                MailMessage... messages)

        Send the specified message.

        Parameters:
        connection - Connection to a server
        messages - The array of MailMessage that represents an email-messages to send.
      • send

        public final void send(IConnection connection,
                MailMessageCollection messages)

        Send the specified message collection.

        Parameters:
        connection - Connection to a server
        messages - The collection of messages.
      • send

        public final void send(IConnection connection,
                Iterable<MailMessage> messages)

        Send the specified messages.

        Parameters:
        connection - Connection to a server
        messages - The IEnumerator that supports a message iteration.
      • beginSendQueue

        public final com.aspose.ms.System.IAsyncResult beginSendQueue()

        Begins to execute 'No operation' command

        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSendQueue

        public final com.aspose.ms.System.IAsyncResult beginSendQueue(com.aspose.ms.System.AsyncCallback callback)

        Begins to execute 'No operation' command

        Parameters:
        callback - References a method to be called when a corresponding asynchronous operation completes.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • beginSendQueue

        public final com.aspose.ms.System.IAsyncResult beginSendQueue(com.aspose.ms.System.AsyncCallback callback,
                                                       Object state)

        Begins to execute 'No operation' command

        Parameters:
        callback - References a method to be called when a corresponding asynchronous operation completes.
        state - The state.
        Returns:
        IAsyncResult that represents the status of an asynchronous operation.
      • endBeginSendQueue

        public final void endBeginSendQueue(com.aspose.ms.System.IAsyncResult asyncResult)

        Waits for the pending asynchronous operation to complete.

        Parameters:
        asyncResult - The reference to the pending asynchronous request to wait for.
      • sendToQueue

        public final void sendToQueue(Iterable<MailMessage> messages)

        Append messages to queue

        Parameters:
        messages - MailMessages to send