![]() |
Qore jni Module 2.4.0
|
Java wrapper for the Qore::SmtpClient class in Qore. More...
Inherits QoreObjectWrapper.
Public Member Methods | |
| SmtpClient (QoreObject ds) | |
| creates the object | |
| SmtpClient (String host, int port) throws Throwable | |
| creates the SmtpClient object | |
| SmtpClient (String url) throws Throwable | |
| creates the SmtpClient object | |
| String | getTarget () throws Throwable |
| Returns the connection target string. | |
| void | tls (boolean n_tls) throws Throwable |
| sets the TLS/SSL flag | |
| boolean | tls () throws Throwable |
| returns the TLS/SSL flag | |
| void | ssl (boolean n_ssl) throws Throwable |
| sets the SSL connection flag | |
| boolean | ssl () throws Throwable |
| returns the SSL connection flag | |
| void | setUserPass (String n_user, String n_pass) throws Throwable |
| sets the username and password for authenticated connections | |
| void | test (boolean ns) throws Throwable |
| sets or disables test mode; no connections are made in test mode | |
| boolean | test () throws Throwable |
| returns the test mode flag | |
| void | connect () throws Throwable |
| Connect to the server with the connection parameters set in the constructor() | |
| boolean | isConnected () throws Throwable |
| return connection status | |
| void | disconnect () throws Throwable |
| disconnect from the server | |
| void | setReadTimeout (int to) throws Throwable |
| sets the read timeout from an integer in milliseconds | |
| void | setReadTimeout (QoreRelativeTime to) throws Throwable |
| sets the read timeout | |
| int | getReadTimeoutMs () throws Throwable |
| returns the read timeout as an integer giving milliseconds | |
| QoreRelativeTime | getReadTimeoutDate () throws Throwable |
| returns the read timeout as a relative time value | |
| void | setConnectTimeout (int to) throws Throwable |
| sets the connect timeout from an integer in milliseconds | |
| void | setConnectTimeout (QoreRelativeTime to) throws Throwable |
| sets the connect timeout | |
| int | getConnectTimeoutMs () throws Throwable |
| returns the connect timeout as an integer giving milliseconds | |
| QoreRelativeTime | getConnectTimeoutDate () throws Throwable |
| returns the connect timeout as a relative time value | |
| HashMap< String, HashMap< String, Object > > | sendMessage (Message message) throws Throwable |
| send a Message to the server | |
| void | forceDisconnect () throws Throwable |
| force disconnect of socket without error | |
| HashMap< String, Object > | getUsageInfo () throws Throwable |
| Returns performance statistics for the socket. | |
| void | clearStats () throws Throwable |
| Clears performance statistics. | |
Java wrapper for the Qore::SmtpClient class in Qore.
import qoremod.SmtpClient.SmtpClient;
|
inline |
creates the SmtpClient object
| host | the hostname of the SMTP server (use "[hostname]" to explicitly specify an ipv6 connection) |
| port | the port number of the SMTP server |
|
inline |
creates the SmtpClient object
| url | the URL of the SMTP server (use "[hostname]" or "[address]" for ipv6 connections); if no protocol (scheme) and no port is given for non-UNIX sockets, then SmtpPort is used as the default port number. This argument is parsed with parse_url(); see smtpclient_protocols for a description of the handling of the protocol (scheme) component of the URL including default ports per protocol (scheme). If an unknown protocol (scheme) is given then a SMTP-UNKNOWN-PROTOCOL exception is raised |
| PARSE-URL-ERROR | the url argument could not be parsed with parse_url() |
| SMTPCLIENT-UNKNOWN-PROTOCOL | the protocol (scheme) given is unknown or unsupported |
| SMTPCLIENT-INVALID-AUTHENTICATION | partial authentication credentials passed; the username or password is missing |
|
inline |
Clears performance statistics.
|
inline |
Connect to the server with the connection parameters set in the constructor()
|
inline |
disconnect from the server
|
inline |
force disconnect of socket without error
|
inline |
Returns the connection target string.
|
inline |
Returns performance statistics for the socket.
"bytes_sent": an integer giving the total amount of bytes sent"bytes_recv": an integer giving the total amount of bytes received"us_sent": an integer giving the total number of microseconds spent sending data"us_recv": an integer giving the total number of microseconds spent receiving data"arg": the optional argument for warning hashes if applicable"timeout": the warning timeout in microseconds if set"min_throughput": the minimum warning throughput in bytes/sec if set
|
inline |
send a Message to the server
| message | the Message to send |
"code": the return code, "desc": the string description):HELO or EHLO: a hash of the reply received from the HELO or EHLO commandRCPT: hash keyed by email address with hash return structures values for the RCPT TO commandMSGID: return structure after the send; generally contains message idQUIT: the server response of the disconnect command| MESSAGE-ERROR | the message is incomplete and cannot be sent |
|
inline |
sets the username and password for authenticated connections
| n_user | the username to set for authentication |
| n_pass | the password to set for authentication |
|
inline |
sets the SSL connection flag
| n_ssl | if True then connections to the SMTP server will immediately try to negotiate transport layer TSL/SSL security; will also in this case turn off the TLS/SSL "STARTTLS" application layer security flag |
|
inline |
sets the TLS/SSL flag
| n_tls | if True then use TLS/SSL; if the TLS/SSL flag is set then the client will issue a "STARTTLS" command after connecting and negotiate a secure TLS/SSL connection to the server; will also in this case turn off the SSL connection flag |