All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class netscape.messaging.smtp.SMTPSink

java.lang.Object
   |
   +----netscape.messaging.smtp.SMTPSink

public class SMTPSink
extends Object
implements ISMTPSink
SMTPSink is the default implementation of the response sink for all SMTP commands.

The SMTPSink object contains callback methods for each client call. The client’s processResponses call invokes the appropriate object method.

The Messaging Access SDK provides the SMTPSink class as a convenience implementation the ISMTPSink interface. You can save a step by extending the SMTPSink class, or you can implement your own class based on the ISMTPSink interface. The constructor for the SMTPClient class takes an ISMTPSink interface as a parameter.

These methods return standard SMTP Response Codes, as defined in RFC 821. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP" for more information. For detailed information about SMTP, see RFC 821. (For the URL, see "Where to Find More Information" in "About This Book.")


Constructor Index

 o SMTPSink()

Method Index

 o bdat(int, StringBuffer)
Notification for the response to the BDAT command.
 o connect(int, StringBuffer)
Notification for the response to the connection to the server.
 o data(int, StringBuffer)
Notification for the response to the DATA command.
 o ehlo(int, StringBuffer)
Notification for the response to the EHLO command.
 o ehloComplete()
Notification for the completion of the EHLO command.
 o error(int, StringBuffer)
Error notification.
 o expand(int, StringBuffer)
Notification for the response to the EXPN command.
 o expandComplete()
Notification for the completion of the EXPN command.
 o help(int, StringBuffer)
Notification for the response to the HELP command.
 o helpComplete()
Notification for the completion of the HELP command.
 o mailFrom(int, StringBuffer)
Notification for the response to the MAIL FROM command.
 o noop(int, StringBuffer)
Notification for the response to the NOOP command.
 o quit(int, StringBuffer)
Notification sink for the response to the QUIT command.
 o rcptTo(int, StringBuffer)
Notification for the response to the RCPT TO command.
 o reset(int, StringBuffer)
Notification for the response to the RSET command.
 o send(int, StringBuffer)
Notification for the response to data sent to the server.
 o sendCommand(int, StringBuffer)
Notification for the response to sendCommand() method.
 o sendCommandComplete()
Notification for the completion of the extended command.
 o verify(int, StringBuffer)
Notification for the response to the VRFY command.

Constructors

 o SMTPSink
 public SMTPSink()

Methods

 o bdat
 public void bdat(int in_responseCode,
                  StringBuffer in_responseMessage)
Notification for the response to the BDAT command. Sends binary data chunks of the specified size to the server. When using the sendCommand method, send data with the data method and not with bdat. Note: bdat is not supported by Messaging Server 4.0. Use data instead.

See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
bdat, data, send
 o connect
 public void connect(int in_responseCode,
                     StringBuffer in_responseMessage)
Notification for the response to the connection to the server.

Connects to the server using the default port. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
connect, quit
 o data
 public void data(int in_responseCode,
                  StringBuffer in_responseMessage)
Notification for the response to the DATA command. Prepares to send data to the server. The sendCommand method requires sending data with the data method and not with bdat. For more information, see RFC 821 (URL: go to SMTP RFCs). See "SMTP Response Codes" in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
data, bdat, send
 o ehlo
 public void ehlo(int in_responseCode,
                  StringBuffer in_serverInfo)
Notification for the response to the EHLO command. Along with ehloComplete, returns extended server information. Can get extended server information (which can be multiline). See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_serverInfo - Extension supported by the server.
See Also:
ehlo, ehloComplete
 o ehloComplete
 public void ehloComplete()
Notification for the completion of the EHLO command. Along with ehlo, returns extended server information.

See Also:
ehlo, ehlo
 o error
 public void error(int in_responseCode,
                   StringBuffer in_errorMessage) throws SMTPServerException
Error notification. Called when an error occurs. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_errorMessage - Text that describes the error.
Throws: SMTPServerException
If a server response error occurs.
See Also:
processResponses
 o expand
 public void expand(int in_responseCode,
                    StringBuffer in_user)
Notification for the response to the EXPN command. Along with expandComplete, gets the email address of the specified user. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_user - User for whom to get an email address.
See Also:
expand, expandComplete
 o expandComplete
 public void expandComplete()
Notification for the completion of the EXPN command. Along with expand, gets the email address of the specified user.

See Also:
expand, expand
 o help
 public void help(int in_responseCode,
                  StringBuffer in_help)
Notification for the response to the HELP command. Along with helpComplete, gets help on the specified topic, which can be multiline. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_help - Line of help text.
See Also:
help, helpComplete
 o helpComplete
 public void helpComplete()
Notification for the completion of the HELP command. Along with help, gets help on a specified topic.

See Also:
help, help
 o mailFrom
 public void mailFrom(int in_responseCode,
                      StringBuffer in_responseMessage)
Notification for the response to the MAIL FROM command. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
mailFrom, rcptTo
 o noop
 public void noop(int in_responseCode,
                  StringBuffer in_responseMessage)
Notification for the response to the NOOP command.

The server responds to commands with a "still here" response. Sending the noop method does nothing except force this response. Can be used to maintain server connection, perhaps being issued at timed intervals to make sure that the server is still active.

Resets the autologout timer inside the server. Not needed by applications that do something and do not maintain the connection. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
noop
 o quit
 public void quit(int in_responseCode,
                  StringBuffer in_responseMessage)
Notification sink for the response to the QUIT command. Ends the session. If the session is in the Authentication state, the server closes the server connection. If the session is in the Transaction state, the server goes into the Update state and deletes any marked messages, and then quits. See "SMTP Response Codes" in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
quit
 o rcptTo
 public void rcptTo(int in_responseCode,
                    StringBuffer in_responseMessage)
Notification for the response to the RCPT TO command. Gets the address of the recipient of the message. Called once for each recipient; should follow the SMTP_mailFrom function. See "SMTP Response Codes" in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
rcptTo, mailFrom
 o reset
 public void reset(int in_responseCode,
                   StringBuffer in_responseMessage)
Notification for the response to the RSET command. Cancels the current mail transfer and all current processes, discards data, and clears all states. Returns to the state that followed the last method that sent the EHLO command. Returns a response code and optional response text. See "SMTP Response Codes" in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
reset, ehlo
 o send
 public void send(int in_responseCode,
                  StringBuffer in_responseMessage)
Notification for the response to data sent to the server. Returns a response code and optional response text. This method requires using the SMTP_data command to send data, rather than SMTP_bdat. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Text that describes the 3-digit Response Code.
See Also:
send, data
 o sendCommand
 public void sendCommand(int in_responseCode,
                         StringBuffer in_responseLine)
Notification for the response to sendCommand() method. Along with sendCommandComplete, extends the protocol to meet client application needs. Sends commands that are not supported by the Messaging SDK implementation of SMTP. Can get extended server information, possibly multiline. See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseLine - Buffer for the response message.
See Also:
sendCommand, sendCommandComplete
 o sendCommandComplete
 public void sendCommandComplete()
Notification for the completion of the extended command. Along with sendCommand, extends the protocol to meet client application needs.

See Also:
sendCommand, sendCommand
 o verify
 public void verify(int in_responseCode,
                    StringBuffer in_responseMessage)
Notification for the response to the VRFY command. Returns a response code and optional response text. For more information, see RFC 821 (URL are listed in SMTP RFCs). See SMTP Response Codes in Chapter 2, "Sending Mail with SMTP."

Parameters:
in_responseCode - 3-digit Response Code, as defined in RFC 821, for the response.
in_responseMessage - Buffer for the response message.
See Also:
verify

All Packages  Class Hierarchy  This Package  Previous  Next  Index