SmtpClient
Inheritance: java.lang.Object, com.aspose.email.EmailClient
All Implemented Interfaces: com.aspose.email.IMailTransferAgent
public final class SmtpClient extends EmailClient implements IMailTransferAgent
Allows applications to send messages by using the Simple Mail Transfer Protocol (SMTP).
Constructors
Methods
SmtpClient()
public SmtpClient()
Initializes a new instance of the SmtpClient class.
SmtpClient(String host)
public SmtpClient(String host)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
SmtpClient(String host, short securityOptions)
public SmtpClient(String host, short securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
securityOptions | short | Security mode for a mail client |
SmtpClient(String host, int port)
public SmtpClient(String host, int port)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
SmtpClient(String host, int port, int securityOptions)
public SmtpClient(String host, int port, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, String username, String password)
public SmtpClient(String host, String username, String password)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
password | java.lang.String | The password. |
SmtpClient(String host, String username, String password, int securityOptions)
public SmtpClient(String host, String username, String password, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
password | java.lang.String | The password. |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, int port, String username, String password)
public SmtpClient(String host, int port, String username, String password)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
password | java.lang.String | The password. |
SmtpClient(String host, int port, String username, String password, int securityOptions)
public SmtpClient(String host, int port, String username, String password, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
password | java.lang.String | The password. |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, String username, String authInfo, boolean useOAuth)
public SmtpClient(String host, String username, String authInfo, boolean useOAuth)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
authInfo | java.lang.String | The user password or XOAUTH2 access token |
useOAuth | boolean | Defines whether SASL XOAUTH2 mechanism is used to login to the server |
SmtpClient(String host, String username, String authInfo, boolean useOAuth, int securityOptions)
public SmtpClient(String host, String username, String authInfo, boolean useOAuth, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
authInfo | java.lang.String | The user password or XOAUTH2 access token |
useOAuth | boolean | Defines whether SASL XOAUTH2 mechanism is used to login to the server |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, int port, String username, String authInfo, boolean useOAuth)
public SmtpClient(String host, int port, String username, String authInfo, boolean useOAuth)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
authInfo | java.lang.String | The user password or XOAUTH2 access token |
useOAuth | boolean | Defines whether SASL XOAUTH2 mechanism is used to login to the server |
SmtpClient(String host, int port, String username, String authInfo, boolean useOAuth, int securityOptions)
public SmtpClient(String host, int port, String username, String authInfo, boolean useOAuth, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
authInfo | java.lang.String | The user password or XOAUTH2 access token |
useOAuth | boolean | Defines whether SASL XOAUTH2 mechanism is used to login to the server |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, String username, ITokenProvider tokenProvider)
public SmtpClient(String host, String username, ITokenProvider tokenProvider)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
tokenProvider | ITokenProvider | TokenProvider allowing to retrieve access token. |
SmtpClient(String host, String username, ITokenProvider tokenProvider, int securityOptions)
public SmtpClient(String host, String username, ITokenProvider tokenProvider, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
username | java.lang.String | The username. |
tokenProvider | ITokenProvider | TokenProvider allowing to retrieve access token. |
securityOptions | int | Security mode for a mail client |
SmtpClient(String host, int port, String username, ITokenProvider tokenProvider)
public SmtpClient(String host, int port, String username, ITokenProvider tokenProvider)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
tokenProvider | ITokenProvider | TokenProvider allowing to retrieve access token. |
SmtpClient(String host, int port, String username, ITokenProvider tokenProvider, int securityOptions)
public SmtpClient(String host, int port, String username, ITokenProvider tokenProvider, int securityOptions)
Initializes a new instance of the SmtpClient class.
Parameters:
Parameter | Type | Description |
---|---|---|
host | java.lang.String | The name of the host used for SMTP. |
port | int | The port used for SMTP. |
username | java.lang.String | The username. |
tokenProvider | ITokenProvider | TokenProvider allowing to retrieve access token. |
securityOptions | int | Security mode for a mail client |
beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message)
public final System.IAsyncResult beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginForward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback, Object state)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(IConnection connection, String sender, String recipient, MailMessage message)
public final System.IAsyncResult beginForward(IConnection connection, String sender, String recipient, MailMessage message)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipient of the forwarded message. |
message | MailMessage | The message for a forwarding. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(IConnection connection, String sender, String recipient, MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginForward(IConnection connection, String sender, String recipient, MailMessage message, System.AsyncCallback callback)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(IConnection connection, String sender, String recipient, MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginForward(IConnection connection, String sender, String recipient, MailMessage message, System.AsyncCallback callback, Object state)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, MailAddressCollection recipients, MailMessage message)
public final System.IAsyncResult beginForward(String sender, MailAddressCollection recipients, MailMessage message)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginForward(String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginForward(String sender, MailAddressCollection recipients, MailMessage message, System.AsyncCallback callback, Object state)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, String recipient, MailMessage message)
public final System.IAsyncResult beginForward(String sender, String recipient, MailMessage message)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, String recipient, MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginForward(String sender, String recipient, MailMessage message, System.AsyncCallback callback)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginForward(String sender, String recipient, MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginForward(String sender, String recipient, MailMessage message, System.AsyncCallback callback, Object state)
Begins forward email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop()
public final System.IAsyncResult beginNoop()
Begins to execute ‘No operation’ command
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop(IConnection connection)
public final System.IAsyncResult beginNoop(IConnection connection)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop(IConnection connection, System.AsyncCallback callback)
public final System.IAsyncResult beginNoop(IConnection connection, System.AsyncCallback callback)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop(IConnection connection, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginNoop(IConnection connection, System.AsyncCallback callback, Object state)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop(System.AsyncCallback callback)
public final System.IAsyncResult beginNoop(System.AsyncCallback callback)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginNoop(System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginNoop(System.AsyncCallback callback, Object state)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, MailMessage message)
public final System.IAsyncResult beginSend(IConnection connection, MailMessage message)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
message | MailMessage | Represents an e-mail message |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(IConnection connection, MailMessage message, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
message | MailMessage | Represents an e-mail message |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(IConnection connection, MailMessage message, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
message | MailMessage | Represents an e-mail message |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, MailMessage[] messages)
public final System.IAsyncResult beginSend(IConnection connection, MailMessage[] messages)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | MailMessage[] | The array of MailMessage that represents an email-messages to send. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages, System.EventHandler messageSentDelegate)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages, System.EventHandler messageSentDelegate, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, Iterable messages, System.EventHandler messageSentDelegate, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(IConnection connection, Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, String from, String recipients, String subject, String body)
public final System.IAsyncResult beginSend(IConnection connection, String from, String recipients, String subject, String body)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, String from, String recipients, String subject, String body, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(IConnection connection, String from, String recipients, String subject, String body, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(IConnection connection, String from, String recipients, String subject, String body, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(IConnection connection, String from, String recipients, String subject, String body, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(MailMessage message)
public final System.IAsyncResult beginSend(MailMessage message)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
message | MailMessage | Represents an e-mail message |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(MailMessage message, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(MailMessage message, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
message | MailMessage | Represents an e-mail message |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(MailMessage message, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(MailMessage message, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
message | MailMessage | Represents an e-mail message |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(MailMessage[] messages)
public final System.IAsyncResult beginSend(MailMessage[] messages)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | MailMessage[] | The array of MailMessage that represents an email-messages to send. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages, System.EventHandler messageSentDelegate)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages, System.EventHandler messageSentDelegate, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(Iterable messages, System.EventHandler messageSentDelegate, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(Iterable<MailMessage> messages, System.EventHandler<MailMessageEventArgs> messageSentDelegate, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The array of MailMessage that represents an email-messages to send. |
messageSentDelegate | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> | References a method to be called when a message has been sent. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(String from, String recipients, String subject, String body)
public final System.IAsyncResult beginSend(String from, String recipients, String subject, String body)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(String from, String recipients, String subject, String body, System.AsyncCallback callback)
public final System.IAsyncResult beginSend(String from, String recipients, String subject, String body, System.AsyncCallback callback)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSend(String from, String recipients, String subject, String body, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSend(String from, String recipients, String subject, String body, System.AsyncCallback callback, Object state)
Begins sending email asynchronously.
Parameters:
Parameter | Type | Description |
---|---|---|
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSendQueue()
public final System.IAsyncResult beginSendQueue()
Begins to execute ‘No operation’ command
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSendQueue(System.AsyncCallback callback)
public final System.IAsyncResult beginSendQueue(System.AsyncCallback callback)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginSendQueue(System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginSendQueue(System.AsyncCallback callback, Object state)
Begins to execute ‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials()
public final System.IAsyncResult beginValidateCredentials()
Begins to execute credentials validation
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials(IConnection connection)
public final System.IAsyncResult beginValidateCredentials(IConnection connection)
Begins to execute credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials(IConnection connection, System.AsyncCallback callback)
public final System.IAsyncResult beginValidateCredentials(IConnection connection, System.AsyncCallback callback)
Begins to execute credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials(IConnection connection, System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginValidateCredentials(IConnection connection, System.AsyncCallback callback, Object state)
Begins to execute credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials(System.AsyncCallback callback)
public final System.IAsyncResult beginValidateCredentials(System.AsyncCallback callback)
Begins to execute credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
beginValidateCredentials(System.AsyncCallback callback, Object state)
public final System.IAsyncResult beginValidateCredentials(System.AsyncCallback callback, Object state)
Begins to execute credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
callback | com.aspose.ms.System.AsyncCallback | References a method to be called when a corresponding asynchronous operation completes. |
state | java.lang.Object | The state. |
Returns: com.aspose.ms.System.IAsyncResult - IAsyncResult that represents the status of an asynchronous operation.
bindIPEndPoint(BindIPEndPointHandler handler)
public void bindIPEndPoint(BindIPEndPointHandler handler)
Associates a Socket with a local endpoint.
Parameters:
Parameter | Type | Description |
---|---|---|
handler | BindIPEndPointHandler |
cancelAsyncOperation(System.IAsyncResult asyncResult)
public final void cancelAsyncOperation(System.IAsyncResult asyncResult)
Cancels asynchronous operation.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | Defines asynchronous operation to cancel. |
close()
public void close()
connectIPEndPoint(BindIPEndPointHandler handler)
public void connectIPEndPoint(BindIPEndPointHandler handler)
Associates a Socket with a remote endpoint.
Parameters:
Parameter | Type | Description |
---|---|---|
handler | BindIPEndPointHandler |
createConnection()
public IConnection createConnection()
Creates new independent connection for operations not linked to threads (not default connection). Invocation of this method is similar to invocation of CreateConnection(createAsDefaultConnection = false) Please see more in documentation for EmailClient.ConnectionAsgmtMode property.
Returns: IConnection - Returns connection object
createConnection(boolean createAsDefaultConnection)
public IConnection createConnection(boolean createAsDefaultConnection)
Creates new (default or independent) connection for operations. Please see more in documentation for EmailClient.ConnectionAsgmtMode property.
Parameters:
Parameter | Type | Description |
---|---|---|
createAsDefaultConnection | boolean | Indicates if connection has to be created as default for current thread |
Returns: IConnection - Returns connection object
dispose()
public void dispose()
Finalizes all operations with a server.
endBeginSendQueue(System.IAsyncResult asyncResult)
public final void endBeginSendQueue(System.IAsyncResult asyncResult)
Waits for the pending asynchronous operation to complete.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | The reference to the pending asynchronous request to wait for. |
endForward(System.IAsyncResult asyncResult)
public final void endForward(System.IAsyncResult asyncResult)
Waits for the asynchronous operation to complete.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | The reference to the pending asynchronous request to wait for. |
endNoop(System.IAsyncResult asyncResult)
public final void endNoop(System.IAsyncResult asyncResult)
Waits for the pending asynchronous operation to complete.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | The reference to the pending asynchronous request to wait for. |
endSend(System.IAsyncResult asyncResult)
public final void endSend(System.IAsyncResult asyncResult)
Waits for the asynchronous operation to complete.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | The reference to the pending asynchronous request to wait for. |
endValidateCredentials(System.IAsyncResult asyncResult)
public final boolean endValidateCredentials(System.IAsyncResult asyncResult)
Waits for the pending asynchronous operation to complete.
Parameters:
Parameter | Type | Description |
---|---|---|
asyncResult | com.aspose.ms.System.IAsyncResult | The reference to the pending asynchronous request to wait for. |
Returns: boolean - True if authentication was successful, otherwise false.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
forward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message)
public final void forward(IConnection connection, String sender, MailAddressCollection recipients, MailMessage message)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
forward(IConnection connection, String sender, MailAddressCollection recipients, InputStream messageStream)
public final void forward(IConnection connection, String sender, MailAddressCollection recipients, InputStream messageStream)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
messageStream | java.io.InputStream | The stream that represents message in eml format. |
forward(IConnection connection, String sender, String recipient, MailMessage message)
public final void forward(IConnection connection, String sender, String recipient, MailMessage message)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipient of the forwarded message. |
message | MailMessage | The message for a forwarding. |
forward(String sender, MailAddressCollection recipients, MailMessage message)
public final void forward(String sender, MailAddressCollection recipients, MailMessage message)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
message | MailMessage | The message for a forwarding. |
forward(String sender, MailAddressCollection recipients, InputStream messageStream)
public final void forward(String sender, MailAddressCollection recipients, InputStream messageStream)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipients | MailAddressCollection | Recipients of the forwarded message. |
messageStream | java.io.InputStream | The stream that represents message in eml format. |
forward(String sender, String recipient, MailMessage message)
public final void forward(String sender, String recipient, MailMessage message)
Forwards specified message to recipient
Parameters:
Parameter | Type | Description |
---|---|---|
sender | java.lang.String | Sender of the forwarded message. |
recipient | java.lang.String | Recipient of the forwarded message. |
message | MailMessage | The message for a forwarding. |
getAccessToken()
public String getAccessToken()
Gets or sets the access token.
Value: The string that represents access token.
Returns: java.lang.String
getAllowedAuthentication()
public final long getAllowedAuthentication()
Gets or sets enumeration of allowed by user authentication types
Returns: long
getCapabilities()
public String[] getCapabilities()
Get Capabilities.
Returns: java.lang.String[]
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getClientCertificates()
public System.Security.Cryptography.X509Certificates.X509CertificateCollection getClientCertificates()
Contains collection of clients certificates
Returns: com.aspose.ms.System.Security.Cryptography.X509Certificates.X509CertificateCollection
getConnectionAsgmtMode()
public int getConnectionAsgmtMode()
Gets or sets value which defines mode of connection allocation in multiple threads environment There are folowing connection types: - Main connection is connection created and disposed together with mail client.It can’t be created or disposed manually. - Default connection is connection default for some thread. If default connection exists and ConnectionAsgmtMode allow, all methods of email client executed in this thread will be implicitly use this connection. Only one default connection can be exist per thread. It can be created manually or automatically. It depends on EmailClient.ConnectionAsgmtMode property. These connections can be created manually with EmailClient.CreateConnection(createAsDefaultConnection = true) method. If default connection does not used(depends on connection allocation mode), main connection used implicitly instead of it. - Independent connections are connections that are not linked to threads.They can be created manually and has to be used explicitly as method parameter. These connections can be created manually with EmailClient.CreateConnection() method or EmailClient.CreateConnection(createAsDefaultConnection = false) method. There are folowing connection allocation types: - ConnectionAsgmtType.UseMainOrDefault This mode uses by default in email clients. Email client uses main connection for all operations from multiple threads if default connection hasn’t been created, or connection hasnt been passed as method parameter explicitly. Main connection is connection which is created in the same time like email client. User can create default connections for threads with CreateConnection method. If default connection for thread is created, it’s used implicitly for all methods of email client which are invoked in this thread. If default connection for thread is not created, main connection is used for all methods of email client which are invoked in this thread. User also can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. Default connection can be only one per thread. Please note default connections works correctly if user uses Thread objects for multitasking programming. If user uses ConnectionPool or uses Task objects for multitasking programming this mode may lead to wrong behaviour of a programm. To avoid this problem user has to manually dispose default conection (if he uses it) in the end of the code which executes in the thread. - ConnectionAsgmtType.UseMain Email client uses main connection for all operations from multiple threads. Main connection is connection which is created in the same time like email client. User cann’t create default connections. User can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. - ConnectionAsgmtType.UseDefault Email client uses implicitly only default connections for all operations from multiple threads. Main connection is not used in this mode. If default connection hasn’t been created for some thread (first invocation of email client method), email client creates default connection implicitly for thread before first operation is executed. User can’t create default connections for threads with CreateConnection method because they are created automatically. When default connection for thread is created, it’s used implicitly for all methods of email client which are invoked in this thread.read. User also can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. Default connection can be only one per thread. Please note default connections works correctly if user uses Thread objects for multitasking programming. If user uses ConnectionPool or uses Task objects for multitasking programming this mode may lead to wrong behaviour of a programm. To avoid this problem user has to manually dispose default conection in the end of the code which executes in the thread.
Returns: int
getConnectionCheckupPeriod()
public int getConnectionCheckupPeriod()
Period of connection checking up in milliseconds. Default value is 5 min.
Returns: int
getConnectionState()
public final int getConnectionState()
Gets the current state of the connection.
Returns: int
getConnectionsQuantity()
public int getConnectionsQuantity()
Gets or sets quantity of connections in multy-connection mode
Returns: int
getCurrentConnection()
public IConnection getCurrentConnection()
Gets current connection according to ConnectionAsgmtMode option
Returns: IConnection
getDefaultPort()
public int getDefaultPort()
Gets default port for client
Returns: int
getDeliveryMethod()
public final int getDeliveryMethod()
Gets or sets the delivery method.
Value: An SmtpDeliveryMethod that indicates how messages are delivered.
Returns: int
getEnableLogger()
public final boolean getEnableLogger()
Gets or sets value which allows enable/disable logger
Returns: boolean
getGreetingTimeout()
public final int getGreetingTimeout()
Gets or sets the greeting timeout that is used when establishing a connection. Please note, greeting timeout can’t be infinite. Email clients may execute enough long operations. To limit the time of operations users have to use EmailClient.Timeout (#getTimeout.getTimeout/#setTimeout(int).setTimeout(int)) property. Values for this property have to have long intervals to not prevent long-time operations. But in some cases, if EmailClient will use only Timeout property connection establishing may take a long time. For instance, the mail client may use the automatic mode to connection establishing. In this mode, the email client goes through all possible connection parameters until the connection is established. SMTP, IMAP, and POP3 servers in case of correct connection establishing send greeting string to the client. Servers may use implicit or explicit (START TLS) SSL/TLS connection initiation. If connection mode is mismatched (for instance, the server waits for an implicit SSL connection but the client tries to establish a non-secured or explicit SSL connection), the server won’t send a greeting string. In this case, the user will wait a long time until the timeout reaches a greeting string, and the client goes to the next connection option. To avoid this problem, the GreetingTimeout property has been introduced. This property allows you to set the timeout for greeting string, and reduce the time of automatic connection establishment.
Value: The greeting timeout in milliseconds
Returns: int
getHelloMessage()
public final String getHelloMessage()
Gets or sets a HELO/EHLO string.
Returns: java.lang.String
getHost()
public String getHost()
Gets or sets the host name.
Value: The host name.
Returns: java.lang.String
getLogFileName()
public final String getLogFileName()
Gets or sets log file name
Returns: java.lang.String
getPassword()
public String getPassword()
Gets or sets the password. Password limitations are defined by server implementation, which client connects.
Value: The string that represents the password.
Returns: java.lang.String
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
Returns: java.lang.String
getPort()
public int getPort()
Gets or sets the port.
Value: The port number.
Returns: int
getProxy()
public Proxy getProxy()
Gets or sets proxy for the client
Returns: Proxy
getSecurityOptions()
public int getSecurityOptions()
Security mode for a mail client
Returns: int
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
Returns: java.lang.String
getSupportedAuthentication()
public final long getSupportedAuthentication()
Gets enumeration of supported by server authentication types
Returns: long
getSupportedEncryption()
public int getSupportedEncryption()
Defines the versions of SSL/TLS encryption protocols to be used. PLEASE PAY YOUR ATTENTION, you may set only those versions of protocol, which are supported by .net framework. IF SOME VERSIONS OF PROTOCOL ARE NOT SUPPORTED BY YOUR CURRENT VERSION OF FRAMEWORK, THEY WILL BE IGNORED AND SKIPPED. IT MAY LEAD TO DOWNGRADE TLS SECURITY LEVEL. IN THIS CASE EXCEPTION WON’T BE GENERATED!!! Please, see EncryptionProtocols documentation for more details. Please use #setSupportedEncryptionUnsafe(int).setSupportedEncryptionUnsafe(int) method if you want to set the encryption protocols without any compatibility checks. Default value is: Tls | Tls11 | Tls12 | Tls13 (in case if your current version of .net framework supports these versions of TLS)
Returns: int
getTimeout()
public final int getTimeout()
Gets or sets the timeout for mail operations
Value: The timeout in milliseconds
Returns: int
getTokenProvider()
public final ITokenProvider getTokenProvider()
Gets or sets TokenProvider allowing to retrieve access token.
Returns: ITokenProvider
getUseAuthentication()
public boolean getUseAuthentication()
Indicates whether authentication is used.
Returns: boolean
getUseDateInLogFileName()
public final boolean getUseDateInLogFileName()
Gets or sets value which indicates if date has to be used in log file name.
Returns: boolean
getUseDefaultCredentials()
public boolean getUseDefaultCredentials()
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
Returns: boolean
getUseMultiConnection()
public int getUseMultiConnection()
Gets or sets value which indicates if client has to use multiple connections for heavy loaded operations. Please note, using of this mode not necessary has to lead to performance increasing.
Returns: int
getUsePipelining()
public PipeliningStatus getUsePipelining()
Gets or sets object which indicates whether the pipelining mode is enabled.
Returns: PipeliningStatus
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.
Returns: boolean
getUsername()
public String getUsername()
Gets or sets the username.
Value: The username string.
Returns: java.lang.String
hashCode()
public native int hashCode()
Returns: int
noop()
public void noop()
‘No operation’ command
noop(IConnection connection)
public void noop(IConnection connection)
‘No operation’ command
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
resetLogSettings()
public final void resetLogSettings()
Resets logging settings to default.
send(IConnection connection, MailMessage message)
public final void send(IConnection connection, MailMessage message)
Send the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
message | MailMessage | The MailMessage that represents an email-message. |
send(IConnection connection, MailMessage[] messages)
public final void send(IConnection connection, MailMessage[] messages)
Send the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | MailMessage[] | The array of MailMessage that represents an email-messages to send. |
send(IConnection connection, MailMessageCollection messages)
public final void send(IConnection connection, MailMessageCollection messages)
Send the specified message collection.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | MailMessageCollection | The collection of messages. |
send(IConnection connection, Iterable messages)
public final void send(IConnection connection, Iterable<MailMessage> messages)
Send the specified messages.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The IEnumerator that supports a message iteration. |
send(IConnection connection, String from, String recipients, String subject, String body)
public final void send(IConnection connection, String from, String recipients, String subject, String body)
Creates and sends the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
send(MailMessage message)
public final void send(MailMessage message)
Send the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
message | MailMessage | The MailMessage that represents an email-message. |
send(MailMessage[] messages)
public final void send(MailMessage[] messages)
Send the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | MailMessage[] | The array of MailMessage that represents an email-messages to send. |
send(MailMessageCollection messages)
public final void send(MailMessageCollection messages)
Send the specified message collection.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | MailMessageCollection | The collection of messages. |
send(Iterable messages)
public final void send(Iterable<MailMessage> messages)
Send the specified messages.
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | The IEnumerator that supports a message iteration. |
send(String from, String recipients, String subject, String body)
public final void send(String from, String recipients, String subject, String body)
Creates and sends the specified message.
Parameters:
Parameter | Type | Description |
---|---|---|
from | java.lang.String | A String that contains the address of message sender. |
recipients | java.lang.String | A String that contains the address of recipients. |
subject | java.lang.String | A subject of message. |
body | java.lang.String | A body of message. |
sendToQueue(Iterable messages)
public final void sendToQueue(Iterable<MailMessage> messages)
Append messages to queue
Parameters:
Parameter | Type | Description |
---|---|---|
messages | java.lang.Iterable<com.aspose.email.MailMessage> | MailMessages to send |
setAccessToken(String value)
public void setAccessToken(String value)
Gets or sets the access token.
Value: The string that represents access token.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setAllowedAuthentication(long value)
public final void setAllowedAuthentication(long value)
Gets or sets enumeration of allowed by user authentication types
Parameters:
Parameter | Type | Description |
---|---|---|
value | long |
setConnectionAsgmtMode(int value)
public void setConnectionAsgmtMode(int value)
Gets or sets value which defines mode of connection allocation in multiple threads environment There are folowing connection types: - Main connection is connection created and disposed together with mail client.It can’t be created or disposed manually. - Default connection is connection default for some thread. If default connection exists and ConnectionAsgmtMode allow, all methods of email client executed in this thread will be implicitly use this connection. Only one default connection can be exist per thread. It can be created manually or automatically. It depends on EmailClient.ConnectionAsgmtMode property. These connections can be created manually with EmailClient.CreateConnection(createAsDefaultConnection = true) method. If default connection does not used(depends on connection allocation mode), main connection used implicitly instead of it. - Independent connections are connections that are not linked to threads.They can be created manually and has to be used explicitly as method parameter. These connections can be created manually with EmailClient.CreateConnection() method or EmailClient.CreateConnection(createAsDefaultConnection = false) method. There are folowing connection allocation types: - ConnectionAsgmtType.UseMainOrDefault This mode uses by default in email clients. Email client uses main connection for all operations from multiple threads if default connection hasn’t been created, or connection hasnt been passed as method parameter explicitly. Main connection is connection which is created in the same time like email client. User can create default connections for threads with CreateConnection method. If default connection for thread is created, it’s used implicitly for all methods of email client which are invoked in this thread. If default connection for thread is not created, main connection is used for all methods of email client which are invoked in this thread. User also can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. Default connection can be only one per thread. Please note default connections works correctly if user uses Thread objects for multitasking programming. If user uses ConnectionPool or uses Task objects for multitasking programming this mode may lead to wrong behaviour of a programm. To avoid this problem user has to manually dispose default conection (if he uses it) in the end of the code which executes in the thread. - ConnectionAsgmtType.UseMain Email client uses main connection for all operations from multiple threads. Main connection is connection which is created in the same time like email client. User cann’t create default connections. User can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. - ConnectionAsgmtType.UseDefault Email client uses implicitly only default connections for all operations from multiple threads. Main connection is not used in this mode. If default connection hasn’t been created for some thread (first invocation of email client method), email client creates default connection implicitly for thread before first operation is executed. User can’t create default connections for threads with CreateConnection method because they are created automatically. When default connection for thread is created, it’s used implicitly for all methods of email client which are invoked in this thread.read. User also can create connections not linked with threads (not default connections) with CreateConnection method. If user wants to use other connections (not main and not default) he has to pass this connection explicitly as parameter of a method which he wants to use. User can additionally create any number of connections. Default connection can be only one per thread. Please note default connections works correctly if user uses Thread objects for multitasking programming. If user uses ConnectionPool or uses Task objects for multitasking programming this mode may lead to wrong behaviour of a programm. To avoid this problem user has to manually dispose default conection in the end of the code which executes in the thread.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setConnectionCheckupPeriod(int value)
public void setConnectionCheckupPeriod(int value)
Period of connection checking up in milliseconds. Default value is 5 min.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setConnectionsQuantity(int value)
public void setConnectionsQuantity(int value)
Gets or sets quantity of connections in multy-connection mode
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setDeliveryMethod(int value)
public final void setDeliveryMethod(int value)
Gets or sets the delivery method.
Value: An SmtpDeliveryMethod that indicates how messages are delivered.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setEnableLogger(boolean value)
public final void setEnableLogger(boolean value)
Gets or sets value which allows enable/disable logger
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setFailedSending(System.EventHandler handler)
public void setFailedSending(System.EventHandler<FailedMailMessageEventArgs> handler)
Adds or removes subscriber for notifications about failed sending operations in smtp queue
Parameters:
Parameter | Type | Description |
---|---|---|
handler | com.aspose.ms.System.EventHandler<com.aspose.email.FailedMailMessageEventArgs> |
setGreetingTimeout(int value)
public final void setGreetingTimeout(int value)
Gets or sets the greeting timeout that is used when establishing a connection. Please note, greeting timeout can’t be infinite. Email clients may execute enough long operations. To limit the time of operations users have to use EmailClient.Timeout (#getTimeout.getTimeout/#setTimeout(int).setTimeout(int)) property. Values for this property have to have long intervals to not prevent long-time operations. But in some cases, if EmailClient will use only Timeout property connection establishing may take a long time. For instance, the mail client may use the automatic mode to connection establishing. In this mode, the email client goes through all possible connection parameters until the connection is established. SMTP, IMAP, and POP3 servers in case of correct connection establishing send greeting string to the client. Servers may use implicit or explicit (START TLS) SSL/TLS connection initiation. If connection mode is mismatched (for instance, the server waits for an implicit SSL connection but the client tries to establish a non-secured or explicit SSL connection), the server won’t send a greeting string. In this case, the user will wait a long time until the timeout reaches a greeting string, and the client goes to the next connection option. To avoid this problem, the GreetingTimeout property has been introduced. This property allows you to set the timeout for greeting string, and reduce the time of automatic connection establishment.
Value: The greeting timeout in milliseconds
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setHelloMessage(String value)
public final void setHelloMessage(String value)
Gets or sets a HELO/EHLO string.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setHost(String value)
public void setHost(String value)
Gets or sets the host name.
Value: The host name.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setLogFileName(String value)
public final void setLogFileName(String value)
Gets or sets log file name
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPassword(String value)
public void setPassword(String value)
Gets or sets the password. Password limitations are defined by server implementation, which client connects.
Value: The string that represents the password.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPickupDirectoryLocation(String value)
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
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setPort(int value)
public void setPort(int value)
Gets or sets the port.
Value: The port number.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setProxy(Proxy value)
public void setProxy(Proxy value)
Gets or sets proxy for the client
Parameters:
Parameter | Type | Description |
---|---|---|
value | Proxy |
setSecurityOptions(int value)
public void setSecurityOptions(int value)
Security mode for a mail client
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setShowCredentialsInLog(boolean value)
public static void setShowCredentialsInLog(boolean value)
Sets value indicating whether Credentials should be displayed in the log. By default, is False.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | True if Credentials should be displayed in the log. |
setSmtpQueueLocation(String value)
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
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
setSocketsLayerVersion2(boolean value)
public static void setSocketsLayerVersion2(boolean value)
Sets value indicating whether Sockets Layer version 2 is used. By default, Sockets Layer version 2 is used.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | False if Sockets Layer version 1 should be used. |
setSocketsLayerVersion2DisableSSLCertificateValidation(boolean value)
public static void setSocketsLayerVersion2DisableSSLCertificateValidation(boolean value)
Disable SSL certificate validation for Sockets Layer version 2
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setSocketsLayerVersion2SSLSocketFactory(SSLSocketFactory value)
public static void setSocketsLayerVersion2SSLSocketFactory(SSLSocketFactory value)
Set SSL Socket Factory for Sockets Layer version 2
Parameters:
Parameter | Type | Description |
---|---|---|
value | javax.net.ssl.SSLSocketFactory |
setSucceededSending(System.EventHandler handler)
public void setSucceededSending(System.EventHandler<MailMessageEventArgs> handler)
Adds or removes subscriber for notifications about succeeded sending of mail messages. Please note, notifications will be invoked from other threads, so you should to implement thread safe event handler. Also note that this event is common to the mail client instance, in case if the client is running in multi-connection mode, messages from all connections will be processed through this event. So the customer has to analyze in his code message from events to understand which message relates to which operation.
Parameters:
Parameter | Type | Description |
---|---|---|
handler | com.aspose.ms.System.EventHandler<com.aspose.email.MailMessageEventArgs> |
setSupportedEncryption(int value)
public void setSupportedEncryption(int value)
Defines the versions of SSL/TLS encryption protocols to be used. PLEASE PAY YOUR ATTENTION, you may set only those versions of protocol, which are supported by .net framework. IF SOME VERSIONS OF PROTOCOL ARE NOT SUPPORTED BY YOUR CURRENT VERSION OF FRAMEWORK, THEY WILL BE IGNORED AND SKIPPED. IT MAY LEAD TO DOWNGRADE TLS SECURITY LEVEL. IN THIS CASE EXCEPTION WON’T BE GENERATED!!! Please, see EncryptionProtocols documentation for more details. Please use #setSupportedEncryptionUnsafe(int).setSupportedEncryptionUnsafe(int) method if you want to set the encryption protocols without any compatibility checks. Default value is: Tls | Tls11 | Tls12 | Tls13 (in case if your current version of .net framework supports these versions of TLS)
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setSupportedEncryptionUnsafe(int value)
public final void setSupportedEncryptionUnsafe(int value)
Defines the versions of SSL/TLS encryption protocols to be used. This method is not safe and sets the encryption protocols without any compatibility checks. Use SupportedEncryption (#getSupportedEncryption.getSupportedEncryption/#setSupportedEncryption(int).setSupportedEncryption(int)) property to safely set only protocols that definitely supported by framework. Please note, if your current framework does not support this level of security, an exception will be thrown when trying to establish a connection to the server.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTimeout(int value)
public final void setTimeout(int value)
Gets or sets the timeout for mail operations
Value: The timeout in milliseconds
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setTokenProvider(ITokenProvider value)
public final void setTokenProvider(ITokenProvider value)
Gets or sets TokenProvider allowing to retrieve access token.
Parameters:
Parameter | Type | Description |
---|---|---|
value | ITokenProvider |
setUseAuthentication(boolean value)
public void setUseAuthentication(boolean value)
Indicates whether authentication is used.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUseDateInLogFileName(boolean value)
public final void setUseDateInLogFileName(boolean value)
Gets or sets value which indicates if date has to be used in log file name.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUseDefaultCredentials(boolean value)
public void setUseDefaultCredentials(boolean value)
Gets or sets a Boolean value that controls whether the DefaultCredentials are sent with requests.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUseMultiConnection(int value)
public void setUseMultiConnection(int value)
Gets or sets value which indicates if client has to use multiple connections for heavy loaded operations. Please note, using of this mode not necessary has to lead to performance increasing.
Parameters:
Parameter | Type | Description |
---|---|---|
value | int |
setUsePipelining(PipeliningStatus value)
public void setUsePipelining(PipeliningStatus value)
Gets or sets object which indicates whether the pipelining mode is enabled.
Parameters:
Parameter | Type | Description |
---|---|---|
value | PipeliningStatus |
setUseTnef(boolean value)
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.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean |
setUsername(String value)
public void setUsername(String value)
Gets or sets the username.
Value: The username string.
Parameters:
Parameter | Type | Description |
---|---|---|
value | java.lang.String |
toString()
public String toString()
Returns: java.lang.String
usePasswordQuotes(boolean value)
public static void usePasswordQuotes(boolean value)
Sets a value indicating whether Quotes should be used in login password syntax with special characters. By default, is True.
Parameters:
Parameter | Type | Description |
---|---|---|
value | boolean | False if Quotes should not be used in login password syntax. |
validateCredentials()
public boolean validateCredentials()
Executes credentials validation
Returns: boolean - True if authentication was successful, otherwise false.
validateCredentials(IConnection connection)
public final boolean validateCredentials(IConnection connection)
Executes credentials validation
Parameters:
Parameter | Type | Description |
---|---|---|
connection | IConnection | Connection to a server |
Returns: boolean - True if authentication was successful, otherwise false.
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |