Article View: borland.public.jbuilder.java.language
Article #17155Re: Sending email in the background.
From: Benjamin Rutt
Date: Mon, 14 Dec 1998 00:00
Date: Mon, 14 Dec 1998 00:00
27 lines
1524 bytes
1524 bytes
From http://www.inquiry.com/techtips/java_pro/index.html:
Q & A - Writing applet to send info from forms to email address
Applies to These Versions Categories
Version Numbers Not Applicable Applets
I am wondering if I can write an applet that will send information from a
number of forms to my email address without all the %$= etc. and without
using CGI scripts (my server doesn't allow CGI scripts).
If the SMTP port (25) on your web server hasn't been disabled by the system
administrator, you can open a socket to it and mimic the SMTP protocol.
Let's say your host is www.sun.com:
Socket s = new Socket("www.sun.com", 25);
PrintStream out = newPrintStream(s.getOutputStream());
Then send the string:
HELO xxx
MAIL FROM: yyy
RCPT TO: baker@www.sun.com
DATA
.
QUIT
Note the misspelling of "HELO". I've done this on purpose to make the point
that the xxx and yyy can be anything; SMTP doesn't check. Don't miss the
"." on the second-to-last line.
Written by inquiry.com Staff on on 7/23/97.
Technical Details
Message-ID:
<01be276b$ba6c5b80$dfe2bcc0@ITS.city.bloomington.in.us>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<74ujok$irh6@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,69ed0ae24b752968 X-Google-Attributes: gidf74b3,public From: "Benjamin Rutt" <brutt@indiana.edu> Subject: Re: Sending email in the background. Date: 1998/12/14 Message-ID: <01be276b$ba6c5b80$dfe2bcc0@ITS.city.bloomington.in.us> X-Deja-AN: 422127792 References: <74ujok$irh6@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.language