|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |
java.lang.Objectjavax.mail.Service
javax.mail.Transport
com.sun.mail.smtp.SMTPTransport
public class SMTPTransport
このクラスは、メッセージサブミッションと転送の為に SMTP を使用する Transport 抽象クラスを実装します。 SMTP プロトコルプロバイダの詳細に関しては jp.sourceforge.livez.mail.smtp パッケージドキュメンテーションを参照して下さい。
ConnectionEvent
,
TransportEvent
フィールドの概要 |
---|
クラス javax.mail.Service から継承されたフィールド |
---|
debug, session, url |
コンストラクタの概要 | |
---|---|
SMTPTransport(Session session,
URLName urlname)
コンストラクタです。 |
|
SMTPTransport(Session session,
URLName urlname,
String name,
int defaultPort,
boolean isSSL)
このクラスと SMTPSSLTransport サブクラスによって使用されるコンストラクタです。 |
メソッドの概要 | |
---|---|
void |
close()
サーバを閉じ、接続を終了させます。 |
void |
connect(Socket socket)
Start the SMTP protocol on the given socket, which was already connected by the caller. |
protected void |
finalize()
キューがガベージコレクト可能になるように、イベントディスパッチャスレッドを停止します。 |
String |
getExtensionParameter(String ext)
Return the parameter the server provided for the specified service extension, or null if the extension isn't supported. |
String |
getLastServerResponse()
Return the last response we got from the server. |
boolean |
getReportSuccess()
Should we report even successful sends by throwing an exception? |
String |
getSASLRealm()
DIGEST-MD5 認証に使用される SASL レルムを取得します。 |
boolean |
getStartTLS()
Should we use the STARTTLS command to secure the connection if the server supports it? |
boolean |
getUseRset()
Should we use the RSET command instead of the NOOP command in the @{link #isConnected isConnected} method? |
boolean |
isConnected()
Check whether the transport is connected. |
protected boolean |
protocolConnect(String host,
int port,
String user,
String passwd)
実際のプロトコル特有の接続試みを実行します。 |
void |
sendMessage(Message message,
Address[] addresses)
Message を指定されたリストのアドレスに送信します。 |
void |
setLocalHost(String localHostName)
EHLO と HELO コマンドを使用する時のローカルホストの名前を設定します。 |
void |
setReportSuccess(boolean reportSuccess)
Set whether successful sends should be reported by throwing an exception. |
void |
setSASLRealm(String saslRealm)
SASL レルムに DIGEST-MD5 認証が使用される様に設定します。 |
void |
setStartTLS(boolean useStartTLS)
Set whether the STARTTLS command should be used. |
void |
setUseRset(boolean useRset)
Set whether the RSET command should be used instead of the NOOP command in the @{link #isConnected isConnected} method. |
boolean |
supportsExtension(String ext)
Return true if the SMTP server supports the specified service extension. |
クラス javax.mail.Transport から継承されたメソッド |
---|
addTransportListener, notifyTransportListeners, removeTransportListener, send, send |
クラス javax.mail.Service から継承されたメソッド |
---|
addConnectionListener, connect, connect, connect, connect, getURLName, notifyConnectionListeners, queueEvent, removeConnectionListener, setConnected, setURLName, toString |
クラス java.lang.Object から継承されたメソッド |
---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
コンストラクタの詳細 |
---|
public SMTPTransport(Session session, URLName urlname)
public SMTPTransport(Session session, URLName urlname, String name, int defaultPort, boolean isSSL)
メソッドの詳細 |
---|
public final void setLocalHost(String localHostName)
public final void connect(Socket socket) throws MessagingException
MessagingException
public final String getSASLRealm()
public final void setSASLRealm(String saslRealm)
saslRealm
- SASL 認証に使用するレルムの名前public final boolean getReportSuccess()
SendFailedException
will always be thrown and
an SMTPAddressSucceededException
will be included in the exception
chain for each successful address, along with the usual
SMTPAddressFailedException
for each unsuccessful address.
public final void setReportSuccess(boolean reportSuccess)
reportSuccess
- should we throw an exception on success?public final boolean getStartTLS()
public final void setStartTLS(boolean useStartTLS)
useStartTLS
- should we use the STARTTLS command?public boolean getUseRset()
public void setUseRset(boolean useRset)
useRset
- should we use the RSET command?public final String getLastServerResponse()
protected final boolean protocolConnect(String host, int port, String user, String passwd) throws MessagingException
mail.smtp.ehlo が false に設定されない場合、 ESMTP コマンド EHLO を使用して自身を特定しようとします。 If mail.smtp.auth is set to true, we insist on having a username and password, and will try to authenticate ourselves if the server supports the AUTH extension (RFC 2554).
Service
内の protocolConnect
host
- the name of the host to connect toport
- the port to use (-1 means use default port)user
- the name of the user to login aspasswd
- the user's password
MessagingException
- for non-authentication failurespublic final void sendMessage(Message message, Address[] addresses) throws MessagingException, SendFailedException
If all the addresses
succeed the SMTP check
using the RCPT TO:
command, we attempt to send the message.
A TransportEvent of type MESSAGE_DELIVERED is fired indicating the
successful submission of a message to the SMTP host.
If some of the addresses
fail the SMTP check,
and the mail.stmp.sendpartial
property is not set,
sending is aborted. The TransportEvent of type MESSAGE_NOT_DELIVERED
is fired containing the valid and invalid addresses. The
SendFailedException is also thrown.
If some of the addresses
fail the SMTP check,
and the mail.stmp.sendpartial
property is set to true,
the message is sent. The TransportEvent of type
MESSAGE_PARTIALLY_DELIVERED
is fired containing the valid and invalid addresses. The
SMTPSendFailedException is also thrown.
MessagingException is thrown if the message can't write out
an RFC822-compliant stream using its writeTo
method.
Transport
内の sendMessage
message
- 送信される MimeMessageaddresses
- このメッセージの送信先アドレスのリスト
SMTPSendFailedException
- if the send failed because of an SMTP command error
SendFailedException
- 無効なアドレスの為に送信が失敗した場合
MessagingException
- 接続が終了している場合、又は接続状態にない場合、又はメッセージが MimeMessage ではない場合TransportEvent
public final void close() throws MessagingException
Service
内の close
MessagingException
- クローズ中のエラーの場合ConnectionEvent
public final boolean isConnected()
Service
内の isConnected
protected void finalize() throws Throwable
Service
の記述:
Service
内の finalize
Throwable
public boolean supportsExtension(String ext)
ext
- the service extension name
public final String getExtensionParameter(String ext)
ext
- the service extension name
|
||||||||||
前のクラス 次のクラス | フレームあり フレームなし | |||||||||
概要: 入れ子 | フィールド | コンストラクタ | メソッド | 詳細: フィールド | コンストラクタ | メソッド |