All Packages Class Hierarchy This Package Previous Next Index
Class COM.ibm.net.SMTPClient
java.lang.Object
|
+----COM.ibm.net.InetProtocolClient
|
+----COM.ibm.net.SMTPClient
- public class SMTPClient
- extends InetProtocolClient
Implements a Simple Mail Transfer Protocol (RFC 821) client.
Internally supported SMTP commands:
HELO MAIL RCPT DATA SEND QUIT
Unsupported commands:
RSET SOML SAML VRFY EXPN HELP NOOP TURN
Copyright (c) Taligent, Inc. 1996 - 1997.
Copyright (c) IBM Corporation 1996 - 1997.
All Rights Reserved.
-
sender
- Sender email address.
-
SMTPClient()
- Empty default constructor.
-
SMTPClient(String, int, String)
- Constructs a mail session with a SMTP server.
-
SMTPClient(String, String)
- Constructs a mail session with a SMTP server.
-
mailSent()
- Terminate sending mail.
-
sendMail(String)
- Send mail to a single recipient.
-
sendMail(String[])
- Send mail to a single recipient.
sender
public String sender
- Sender email address.
SMTPClient
public SMTPClient()
- Empty default constructor.
SMTPClient
public SMTPClient(String mailServ,
String from)
- Constructs a mail session with a SMTP server.
SMTPClient will use port 25 by default.
- Parameters:
- mailServ - Name or IP address of the mail server
- from - Email address of the sender
SMTPClient
public SMTPClient(String mailServ,
int port,
String from)
- Constructs a mail session with a SMTP server.
- Parameters:
- mailServ - Name or IP address of the mail server
- from - Email address of the sender
- port - Port number of the mail server
sendMail
public PrintWriter sendMail(String recipient) throws IOException
- Send mail to a single recipient. Use the returned PrintWriter
to write the mail header and body. If any line in the body
begins with a period ('.'), add an extra period before writing
the remainder of the line. This is required for SMTP conformance.
You must call mailSent() to indicate that the
message has been written. Do not close the PrintWriter stream.
- Parameters:
- recipient - Email address of the recipient
- Throws: IOException
- Could not initiate sending mail
- See Also:
- mailSent, PrintWriter
sendMail
public PrintWriter sendMail(String recipients[]) throws IOException
- Send mail to a single recipient. Use the returned PrintWriter
to write the mail header and body. If any line in the body
begins with a period ('.'), add an extra period before writing
the remainder of the line. This is required for SMTP conformance.
You must call mailSent() to indicate that the
message has been written. Do not close the PrintWriter stream.
- Parameters:
- recipients - Array of email addresses
- Throws: IOException
- Could not initiate sending mail
- See Also:
- mailSent, PrintWriter
mailSent
public void mailSent() throws IOException
- Terminate sending mail. Must be called after
calling sendMail().
- Throws: IOException
- Could not terminate mail
- See Also:
- sendMail, sendMail
All Packages Class Hierarchy This Package Previous Next Index