/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/**
* This class implements the SMTP client.
* You can send a piece of mail by creating a new SmtpClient, calling
* the "to" method to add destinations, calling "from" to name the
* sender, calling startMessage to return a stream to which you write
* the message (with RFC733 headers) and then you finally close the Smtp
* Client.
*
* @author James Gosling
*/
/**
* issue the QUIT command to the SMTP server and close the connection.
*/
if (serverIsOpen()) {
closeMessage();
super.closeServer();
}
}
int reply;
if (reply != 220) {
throw new SmtpProtocolException(getResponseString());
}
}
if (s.startsWith("<"))
else
}
int st = 0;
int pos = 0;
int lastnonsp = 0;
int parendepth = 0;
boolean ignore = false;
if (parendepth > 0) {
if (c == '(')
parendepth++;
else if (c == ')')
parendepth--;
if (parendepth == 0)
ignore = true;
else
} else if (c == '(')
parendepth++;
else if (c == '<')
else if (c == '>')
ignore = true;
else if (c == ',') {
ignore = false;
} else {
if (c > ' ' && !ignore)
st++;
}
pos++;
}
}
if (s.startsWith("<"))
else
}
/** open a SMTP connection to host <i>host</i>. */
}
try {
} catch (UnsupportedEncodingException e) {
}
return message;
}
}
/** New SMTP client connected to host <i>host</i>. */
super();
try {
return;
} catch(Exception e) {
}
}
try {
String s;
return;
}
} catch(Exception e) {
}
try {
mailhost = "localhost";
} catch(Exception e) {
mailhost = "mailhost";
}
}
/** Create an uninitialized SMTP client. */
this(null);
}
super();
try {
String s;
return;
}
} catch(Exception e) {
}
try {
mailhost = "localhost";
} catch(Exception e) {
mailhost = "mailhost";
}
}
return mailhost;
}
return encoding;
}
}
}
public void close() {
return;
if (lastc != '\n') {
write('\n');
}
try {
} catch (IOException e) {
}
}
public void write(int b) {
try {
// quote a dot at the beginning of a line
}
// translate NL to CRLF
}
lastc = b;
} catch (IOException e) {
}
}
try {
while (--len >= 0) {
int c = b[off++];
// quote a dot at the beginning of a line
// translate NL to CRLF
}
lc = c;
}
} catch (IOException e) {
}
}
for (int i = 0; i < len; i++) {
}
}
}