September 19th, 2000, 01:01 AM
How to send mails using SMTP in Servlets or there are any way to send mails without using SMTP.
October 2nd, 2000, 03:44 AM
The short answer (without looking it up) :
- connect to a SMTP server of your choice, port 25
- send (on separate lines):
- HELO yourdomain.com
- mail from: email@example.com
- rcpt to: firstname.lastname@example.org
- Subject: the subject
- 1 or more lines of text (mail body)
- . (just 1 period on a single line)
- QUIT (to break the connection)
You can try this by telnetting to port 25 on your server and trying the above, to see what the server responses are. Note: the domain in the HELO message does not really matter, put what you like.
Also I did a quick lookaround and found an open-source mail servlet on http://www.coolservlets.com/CSMailForm/ .