Last updated 2004-06-28 by Roedy
Green ©1996-2004 Canadian Mind Products
Java definitions: 0-9 A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
You are here : home : Java Glossary : S words : SMTP.
SmtpClient c = new SmtpClient(server); c.from(sender); c.to(recipient); PrintStream p = c .startMessage(); p.println( "" ); p.println( "Subject: Test of SMTP Server" ); p.println( "" ); p.println( "Hi" ); c.closeServer();
SMTP is so simple you could roll your own code to send mail with it using a URLConnection. Here is David Flanagan's source code to do it that way. Here is the Java Boutique code for SMTP.
SMTP is a kludgy anachronism. It lives on simply because everyone uses it. One of its major failings is a lack of authentication protocol. It has no official logon mechanism to prevent spammers from using your mail server to dispense SPAM.
Mail servers use various ad hoc schemes to protect themselves from unauthorised use:
RFC 821 describes the SMTP send mail protocol. You would use this to implement SendMail at the socket level with HELO commands and numbered responses.
If you talk to a mailserver, you can send mail to anyone in that domain without identifying yourself, however, if you want the mailserver to relay mail for you outside its domain, you need some way of identifying yourself. Mailservers drop off relayed mail using that same SMTP protocol.
home |
Canadian Mind Products | |||
| mindprod.com IP:[24.87.56.253] | ||||
| Your IP:[80.134.30.163] | ||||
| You are visitor number 3464. | ||||
| Please send errors, omissions and suggestions | ||||
| to improve this page to Roedy Green. | ||||
| You can get a fresh copy of this page from: | or possibly from your local J: drive mirror: | |||
| http://mindprod.com/jgloss/smtp.html | J:\mindprod\jgloss\smtp.html | |||