<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSwing_Components%2FEmail_Client</id>
		<title>Java/Swing Components/Email Client - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://jexp.ru/index.php?action=history&amp;feed=atom&amp;title=Java%2FSwing_Components%2FEmail_Client"/>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Swing_Components/Email_Client&amp;action=history"/>
		<updated>2026-04-07T18:42:52Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Swing_Components/Email_Client&amp;diff=8201&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Swing_Components/Email_Client&amp;diff=8201&amp;oldid=prev"/>
				<updated>2010-06-01T06:56:19Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 06:56, 1 июня 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>http://jexp.ru/index.php?title=Java/Swing_Components/Email_Client&amp;diff=8200&amp;oldid=prev</id>
		<title> в 18:01, 31 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://jexp.ru/index.php?title=Java/Swing_Components/Email_Client&amp;diff=8200&amp;oldid=prev"/>
				<updated>2010-05-31T18:01:46Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== A Client to Send SMTP Mail ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- start source code --&amp;gt;&lt;br /&gt;
   &lt;br /&gt;
    &amp;lt;source lang=&amp;quot;java&amp;quot;&amp;gt;&lt;br /&gt;
import java.awt.*;&lt;br /&gt;
import javax.swing.*;&lt;br /&gt;
/**&lt;br /&gt;
 * Example program from Chapter 1 Programming Spiders, Bots and Aggregators in&lt;br /&gt;
 * Java Copyright 2001 by Jeff Heaton&lt;br /&gt;
 * &lt;br /&gt;
 * SendMail is an example of client sockets. This program presents a simple&lt;br /&gt;
 * dialog box that prompts the user for information about how to send a mail.&lt;br /&gt;
 * &lt;br /&gt;
 * @author Jeff Heaton&lt;br /&gt;
 * @version 1.0&lt;br /&gt;
 */&lt;br /&gt;
/*&lt;br /&gt;
 * Using the SMTP Program&lt;br /&gt;
 * &lt;br /&gt;
 * To use the program in Listing 1.2, you must know the address of an SMTP&lt;br /&gt;
 * server usually provided by your ISP. If you are unsure of your SMTP server,&lt;br /&gt;
 * you should contact your ISP&amp;quot;s customer service. In order for outbound e-mail&lt;br /&gt;
 * messages to be sent, your e-mail program must have this address. Once it&lt;br /&gt;
 * does, you can enter who is sending the e-mail (if you are sending it, you&lt;br /&gt;
 * would type your e-mail address in) and who will be on the receiving end. This&lt;br /&gt;
 * is usually entered under the Reply To field of your e-mail program. Both of&lt;br /&gt;
 * these addresses must be valid. If they are invalid, the e-mail may not be&lt;br /&gt;
 * sent. After you have entered these addresses, you should continue by entering&lt;br /&gt;
 * the subject, writing the actual message, and then clicking send. Note&lt;br /&gt;
 * &lt;br /&gt;
 * For more information on how to compile examples in this book, see Appendix E&lt;br /&gt;
 * &amp;quot;How to Compile Examples Under Windows.&amp;quot;&lt;br /&gt;
 * &lt;br /&gt;
 * As stated earlier, to send an e-mail with this program, you must enter who is&lt;br /&gt;
 * sending the message. You may be thinking that you could enter any e-mail&lt;br /&gt;
 * address you want here, right? Yes, this is true; as long as the SMTP server&lt;br /&gt;
 * allows it, this program will allow you to impersonate anyone you enter into&lt;br /&gt;
 * the To address field. However, as previously stated, a savvy Internet user&lt;br /&gt;
 * can tell whether the e-mail address is fake.&lt;br /&gt;
 * &lt;br /&gt;
 * After the mention of possible misrepresentation of identity on the sender&amp;quot;s&lt;br /&gt;
 * end, you may now be asking yourself, Is this program dangerous? This&lt;br /&gt;
 * program is no more dangerous than any e-mail client (such as Microsoft&lt;br /&gt;
 * Outlook Express or Eudora) that also requires you to tell it who you are. In&lt;br /&gt;
 * general, all e-mail programs must request both your identity and that of the&lt;br /&gt;
 * SMTP server. Examining the SMTP Server&lt;br /&gt;
 * &lt;br /&gt;
 * You will now be shown how this program works. We will begin by looking at how&lt;br /&gt;
 * a client socket is created. When the client socket is first instantiated, you&lt;br /&gt;
 * must specify two parameters. First, you must specify the host to connect to;&lt;br /&gt;
 * second, you must specify the port number (e.g., 80) you would like to connect&lt;br /&gt;
 * on. These two items are generally passed into the constructor. The following&lt;br /&gt;
 * line of code (from Listing 1.2) accomplishes this:&lt;br /&gt;
 * &lt;br /&gt;
 * java.net.Socket s =new java.net.Socket( _smtp.getText(),25 );&lt;br /&gt;
 * &lt;br /&gt;
 * This line of code creates a new socket, named s. The first parameter to the&lt;br /&gt;
 * constructor, _smtp .getText(), specifies the address to connect to. Here it&lt;br /&gt;
 * is being read directly from a text field. The second parameter specifies the&lt;br /&gt;
 * port to connect to. (The port for SMTP is 25.) Table 1.1 shows a listing of&lt;br /&gt;
 * the ports associated with most Internet services. The hostname is retrieved&lt;br /&gt;
 * from the _smtp class level variable, which is the JTextField control that the&lt;br /&gt;
 * SMTP hostname is entered into.&lt;br /&gt;
 * &lt;br /&gt;
 * If any errors occur while you are making the connection to the specified&lt;br /&gt;
 * host, the Socket constructor will throw an IOException. Once this connection&lt;br /&gt;
 * is made, input and output streams are obtained from the Socket.getInputStream&lt;br /&gt;
 * and Socket.getOutputStream methods. This is done with the following lines of&lt;br /&gt;
 * code from Listing 1.2:&lt;br /&gt;
 * &lt;br /&gt;
 * _out = new java.io.PrintWriter(s.getOutputStream());&lt;br /&gt;
 * _in = new java.io.BufferedReader(new java.io.InputStreamReader(s.getInputStream()));&lt;br /&gt;
 * &lt;br /&gt;
 * These low-level stream types are only capable of reading binary data. Because&lt;br /&gt;
 * this data is needed in text format, filters are used to wrap the lower-level&lt;br /&gt;
 * input and output streams obtained from the socket.&lt;br /&gt;
 * &lt;br /&gt;
 * In the code above, the output stream has been wrapped in a PrintWriter&lt;br /&gt;
 * object. This is because PrintWriter allows the program to output text to the&lt;br /&gt;
 * socket in a similar manner to the way an application would write data to the&lt;br /&gt;
 * System.out object by using the print and println methods. The application&lt;br /&gt;
 * presented here uses the println method to send commands to the SMTP server.&lt;br /&gt;
 * As you can see in the code, the InputStream object has also been wrapped; in&lt;br /&gt;
 * this case, it has been wrapped in a BufferedReader. Before this could happen,&lt;br /&gt;
 * however, this object must first have been wrapped in an InputStreamReader&lt;br /&gt;
 * object as shown here:&lt;br /&gt;
 * &lt;br /&gt;
 * _in = new java.io.BufferedReader(new&lt;br /&gt;
 * java.io.InputStreamReader(s.getInputStream()));&lt;br /&gt;
 * &lt;br /&gt;
 * This is done because the BufferedReader object provides reads that are made&lt;br /&gt;
 * up of lines of text instead of individual bytes. This way, the program can&lt;br /&gt;
 * read text up to a carriage return without having to parse the individual&lt;br /&gt;
 * characters. This is done with the readLine method.&lt;br /&gt;
 * &lt;br /&gt;
 * You will now be shown how each command is sent to the SMTP server. Each of&lt;br /&gt;
 * these commands that is sent results in a response being issued from the SMTP&lt;br /&gt;
 * server. For the protocol to work correctly, each response must be read by the&lt;br /&gt;
 * SMTP client program. These responses start with a number and then they give a&lt;br /&gt;
 * textual description of what the result was. A full-featured SMTP client&lt;br /&gt;
 * should examine these codes and ensure that no error has occurred.&lt;br /&gt;
 * &lt;br /&gt;
 * For the purposes of the SendMail example, we will simple ignore these&lt;br /&gt;
 * responses because most are informational and not needed. Instead, for our&lt;br /&gt;
 * purposes, the response will be read in and displayed to the _output list box.&lt;br /&gt;
 * Commands that have been sent to the server are displayed in this list with a&lt;br /&gt;
 * C: prefix to indicate that they are from the client. Responses returned from&lt;br /&gt;
 * the SMTP server will be displayed with the S: prefix.&lt;br /&gt;
 * &lt;br /&gt;
 * To accomplish this, the example program will use the send method. The send&lt;br /&gt;
 * method accepts a single String parameter to indicate the SMTP command to be&lt;br /&gt;
 * issued. Once this command is sent, the send method awaits a response from the&lt;br /&gt;
 * SMTP host. The portion of Listing 1.2 that contains the send method is&lt;br /&gt;
 * displayed here:&lt;br /&gt;
 * &lt;br /&gt;
 * protected void send(String s) throws java.io.IOException { &lt;br /&gt;
        // Send the SMTP command &lt;br /&gt;
         if(s!=null) { &lt;br /&gt;
         _model.addElement(&amp;quot;C:&amp;quot;+s); &lt;br /&gt;
         _out.println(s);&lt;br /&gt;
        _out.flush(); } &lt;br /&gt;
       // Wait for the response &lt;br /&gt;
         String line = _in.readLine();&lt;br /&gt;
        if(line!=null) { &lt;br /&gt;
       _model.addElement(&amp;quot;S:&amp;quot;+line); &lt;br /&gt;
       } &lt;br /&gt;
 }&lt;br /&gt;
 * &lt;br /&gt;
 * As you can see, the send method does not handle the exceptions that might&lt;br /&gt;
 * occur from its commands. Instead, they are thrown to the calling method as&lt;br /&gt;
 * indicated by the throws clause of the function declaration. The variable s is&lt;br /&gt;
 * checked to see if it is null. If s is null, then no command is to be sent and&lt;br /&gt;
 * only a response is sought. If s is not null, then the value of s is logged&lt;br /&gt;
 * and then sent to the socket. After this happens, the flush command is given&lt;br /&gt;
 * to the socket to ensure that the command was actually sent and not just&lt;br /&gt;
 * buffered. Once the command is sent, the readLine method is called to await&lt;br /&gt;
 * the response from the server. If a response is sent, then it is logged.&lt;br /&gt;
 * &lt;br /&gt;
 * Once the socket is created and the input and output objects are created, the&lt;br /&gt;
 * SMTP session can begin. The following commands manage the entire SMTP&lt;br /&gt;
 * session:&lt;br /&gt;
 * &lt;br /&gt;
 * send(null); &lt;br /&gt;
 * send(&amp;quot;HELO &amp;quot; + java.net.InetAddress.getLocalHost().getHostName() );&lt;br /&gt;
 * send(&amp;quot;MAIL FROM: &amp;quot; + _from.getText() ); send(&amp;quot;RCPT TO: &amp;quot; + _to.getText() );&lt;br /&gt;
 * send(&amp;quot;DATA&amp;quot;); &lt;br /&gt;
 * _out.println(&amp;quot;Subject:&amp;quot; + _subject.getText()); _out.println(&lt;br /&gt;
 * _body.getText() ); send(&amp;quot;.&amp;quot;); s.close();&lt;br /&gt;
 * &lt;br /&gt;
 * Tip&lt;br /&gt;
 * &lt;br /&gt;
 * Refer to Table 1.4 in the preceding section to review the details of what&lt;br /&gt;
 * each of the SMTP commands actually means.&lt;br /&gt;
 * &lt;br /&gt;
 * The rest of the SendMail program (as seen in Listing 1.2) is a typical Swing&lt;br /&gt;
 * application. The graphical user interface (GUI) layout for this application&lt;br /&gt;
 * was created using VisualCaf?. The VisualCaf? comments have been left in to&lt;br /&gt;
 * allow the form&amp;quot;s GUI layout to be edited by VisualCaf? if you are using it.&lt;br /&gt;
 * If you are using an environment other than VisualCaf?, you may safely delete&lt;br /&gt;
 * the VisualCaf? comments (lines starting in //). The VisualCaf? code only&lt;br /&gt;
 * consists of comments and does not need to be deleted to run on other&lt;br /&gt;
 * platforms.&lt;br /&gt;
 *  &lt;br /&gt;
 */&lt;br /&gt;
public class SendMail extends javax.swing.JFrame {&lt;br /&gt;
  /**&lt;br /&gt;
   * The constructor. Do all basic setup for this application.&lt;br /&gt;
   */&lt;br /&gt;
  public SendMail() {&lt;br /&gt;
    //{{INIT_CONTROLS&lt;br /&gt;
    setTitle(&amp;quot;SendMail Example&amp;quot;);&lt;br /&gt;
    getContentPane().setLayout(null);&lt;br /&gt;
    setSize(736, 312);&lt;br /&gt;
    setVisible(false);&lt;br /&gt;
    JLabel1.setText(&amp;quot;From:&amp;quot;);&lt;br /&gt;
    getContentPane().add(JLabel1);&lt;br /&gt;
    JLabel1.setBounds(12, 12, 36, 12);&lt;br /&gt;
    JLabel2.setText(&amp;quot;To:&amp;quot;);&lt;br /&gt;
    getContentPane().add(JLabel2);&lt;br /&gt;
    JLabel2.setBounds(12, 48, 36, 12);&lt;br /&gt;
    JLabel3.setText(&amp;quot;Subject:&amp;quot;);&lt;br /&gt;
    getContentPane().add(JLabel3);&lt;br /&gt;
    JLabel3.setBounds(12, 84, 48, 12);&lt;br /&gt;
    JLabel4.setText(&amp;quot;SMTP Server:&amp;quot;);&lt;br /&gt;
    getContentPane().add(JLabel4);&lt;br /&gt;
    JLabel4.setBounds(12, 120, 84, 12);&lt;br /&gt;
    getContentPane().add(_from);&lt;br /&gt;
    _from.setBounds(96, 12, 300, 24);&lt;br /&gt;
    getContentPane().add(_to);&lt;br /&gt;
    _to.setBounds(96, 48, 300, 24);&lt;br /&gt;
    getContentPane().add(_subject);&lt;br /&gt;
    _subject.setBounds(96, 84, 300, 24);&lt;br /&gt;
    getContentPane().add(_smtp);&lt;br /&gt;
    _smtp.setBounds(96, 120, 300, 24);&lt;br /&gt;
    getContentPane().add(_scrollPane2);&lt;br /&gt;
    _scrollPane2.setBounds(12, 156, 384, 108);&lt;br /&gt;
    _body.setText(&amp;quot;Enter your message here.&amp;quot;);&lt;br /&gt;
    _scrollPane2.getViewport().add(_body);&lt;br /&gt;
    _body.setBounds(0, 0, 381, 105);&lt;br /&gt;
    Send.setText(&amp;quot;Send&amp;quot;);&lt;br /&gt;
    Send.setActionCommand(&amp;quot;Send&amp;quot;);&lt;br /&gt;
    getContentPane().add(Send);&lt;br /&gt;
    Send.setBounds(60, 276, 132, 24);&lt;br /&gt;
    Cancel.setText(&amp;quot;Cancel&amp;quot;);&lt;br /&gt;
    Cancel.setActionCommand(&amp;quot;Cancel&amp;quot;);&lt;br /&gt;
    getContentPane().add(Cancel);&lt;br /&gt;
    Cancel.setBounds(216, 276, 120, 24);&lt;br /&gt;
    getContentPane().add(_scrollPane);&lt;br /&gt;
    _scrollPane.setBounds(408, 12, 312, 288);&lt;br /&gt;
    getContentPane().add(_output);&lt;br /&gt;
    _output.setBounds(408, 12, 309, 285);&lt;br /&gt;
    //}}&lt;br /&gt;
    //{{INIT_MENUS&lt;br /&gt;
    //}}&lt;br /&gt;
    //{{REGISTER_LISTENERS&lt;br /&gt;
    SymAction lSymAction = new SymAction();&lt;br /&gt;
    Send.addActionListener(lSymAction);&lt;br /&gt;
    Cancel.addActionListener(lSymAction);&lt;br /&gt;
    //}}&lt;br /&gt;
    _output.setModel(_model);&lt;br /&gt;
    _model.addElement(&amp;quot;Server output displayed here:&amp;quot;);&lt;br /&gt;
    _scrollPane.getViewport().setView(_output);&lt;br /&gt;
    _scrollPane2.getViewport().setView(_body);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Moves the app to the correct position when it is made visible.&lt;br /&gt;
   * &lt;br /&gt;
   * @param b&lt;br /&gt;
   *            True to make visible, false to make invisible.&lt;br /&gt;
   */&lt;br /&gt;
  public void setVisible(boolean b) {&lt;br /&gt;
    if (b)&lt;br /&gt;
      setLocation(50, 50);&lt;br /&gt;
    super.setVisible(b);&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * The main function basically just creates a new object, then shows it.&lt;br /&gt;
   * &lt;br /&gt;
   * @param args&lt;br /&gt;
   *            Command line arguments. Not used in this application.&lt;br /&gt;
   */&lt;br /&gt;
  static public void main(String args[]) {&lt;br /&gt;
    (new SendMail()).show();&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Created by VisualCafe. Sets the window size.&lt;br /&gt;
   */&lt;br /&gt;
  public void addNotify() {&lt;br /&gt;
    // Record the size of the window prior to&lt;br /&gt;
    // calling parents addNotify.&lt;br /&gt;
    Dimension size = getSize();&lt;br /&gt;
    super.addNotify();&lt;br /&gt;
    if (frameSizeAdjusted)&lt;br /&gt;
      return;&lt;br /&gt;
    frameSizeAdjusted = true;&lt;br /&gt;
    // Adjust size of frame according to the&lt;br /&gt;
    // insets and menu bar&lt;br /&gt;
    Insets insets = getInsets();&lt;br /&gt;
    javax.swing.JMenuBar menuBar = getRootPane().getJMenuBar();&lt;br /&gt;
    int menuBarHeight = 0;&lt;br /&gt;
    if (menuBar != null)&lt;br /&gt;
      menuBarHeight = menuBar.getPreferredSize().height;&lt;br /&gt;
    setSize(insets.left + insets.right + size.width, insets.top&lt;br /&gt;
        + insets.bottom + size.height + menuBarHeight);&lt;br /&gt;
  }&lt;br /&gt;
  // Used by addNotify&lt;br /&gt;
  boolean frameSizeAdjusted = false;&lt;br /&gt;
  //{{DECLARE_CONTROLS&lt;br /&gt;
  /**&lt;br /&gt;
   * A label.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JLabel JLabel1 = new javax.swing.JLabel();&lt;br /&gt;
  /**&lt;br /&gt;
   * A label.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JLabel JLabel2 = new javax.swing.JLabel();&lt;br /&gt;
  /**&lt;br /&gt;
   * A label.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JLabel JLabel3 = new javax.swing.JLabel();&lt;br /&gt;
  /**&lt;br /&gt;
   * A label.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JLabel JLabel4 = new javax.swing.JLabel();&lt;br /&gt;
  /**&lt;br /&gt;
   * Who this message is from.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JTextField _from = new javax.swing.JTextField();&lt;br /&gt;
  /**&lt;br /&gt;
   * Who this message is to.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JTextField _to = new javax.swing.JTextField();&lt;br /&gt;
  /**&lt;br /&gt;
   * The subject of this message.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JTextField _subject = new javax.swing.JTextField();&lt;br /&gt;
  /**&lt;br /&gt;
   * The SMTP server to use to send this message.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JTextField _smtp = new javax.swing.JTextField();&lt;br /&gt;
  /**&lt;br /&gt;
   * A scroll pane.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JScrollPane _scrollPane2 = new javax.swing.JScrollPane();&lt;br /&gt;
  /**&lt;br /&gt;
   * The body of this email message.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JTextArea _body = new javax.swing.JTextArea();&lt;br /&gt;
  /**&lt;br /&gt;
   * The send button.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JButton Send = new javax.swing.JButton();&lt;br /&gt;
  /**&lt;br /&gt;
   * The cancel button.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JButton Cancel = new javax.swing.JButton();&lt;br /&gt;
  /**&lt;br /&gt;
   * A scroll pain.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JScrollPane _scrollPane = new javax.swing.JScrollPane();&lt;br /&gt;
  /**&lt;br /&gt;
   * The output area. Server messages are displayed here.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.JList _output = new javax.swing.JList();&lt;br /&gt;
  //}}&lt;br /&gt;
  /**&lt;br /&gt;
   * The list of items added to the output list box.&lt;br /&gt;
   */&lt;br /&gt;
  javax.swing.DefaultListModel _model = new javax.swing.DefaultListModel();&lt;br /&gt;
  /**&lt;br /&gt;
   * Input from the socket.&lt;br /&gt;
   */&lt;br /&gt;
  java.io.BufferedReader _in;&lt;br /&gt;
  /**&lt;br /&gt;
   * Output to the socket.&lt;br /&gt;
   */&lt;br /&gt;
  java.io.PrintWriter _out;&lt;br /&gt;
  //{{DECLARE_MENUS&lt;br /&gt;
  //}}&lt;br /&gt;
  /**&lt;br /&gt;
   * Internal class created by VisualCafe to route the events to the correct&lt;br /&gt;
   * functions.&lt;br /&gt;
   * &lt;br /&gt;
   * @author VisualCafe&lt;br /&gt;
   * @version 1.0&lt;br /&gt;
   */&lt;br /&gt;
  class SymAction implements java.awt.event.ActionListener {&lt;br /&gt;
    /**&lt;br /&gt;
     * Route the event to the correction method.&lt;br /&gt;
     * &lt;br /&gt;
     * @param event&lt;br /&gt;
     *            The event.&lt;br /&gt;
     */&lt;br /&gt;
    public void actionPerformed(java.awt.event.ActionEvent event) {&lt;br /&gt;
      Object object = event.getSource();&lt;br /&gt;
      if (object == Send)&lt;br /&gt;
        Send_actionPerformed(event);&lt;br /&gt;
      else if (object == Cancel)&lt;br /&gt;
        Cancel_actionPerformed(event);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called to actually send a string of text to the socket. This method makes&lt;br /&gt;
   * note of the text sent and the response in the JList output box. Pass a&lt;br /&gt;
   * null value to simply wait for a response.&lt;br /&gt;
   * &lt;br /&gt;
   * @param s&lt;br /&gt;
   *            A string to be sent to the socket. null to just wait for a&lt;br /&gt;
   *            response.&lt;br /&gt;
   * @exception java.io.IOException&lt;br /&gt;
   */&lt;br /&gt;
  protected void send(String s) throws java.io.IOException {&lt;br /&gt;
    // Send the SMTP command&lt;br /&gt;
    if (s != null) {&lt;br /&gt;
      _model.addElement(&amp;quot;C:&amp;quot; + s);&lt;br /&gt;
      _out.println(s);&lt;br /&gt;
      _out.flush();&lt;br /&gt;
    }&lt;br /&gt;
    // Wait for the response&lt;br /&gt;
    String line = _in.readLine();&lt;br /&gt;
    if (line != null) {&lt;br /&gt;
      _model.addElement(&amp;quot;S:&amp;quot; + line);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when the send button is clicked. Actually sends the mail message.&lt;br /&gt;
   * &lt;br /&gt;
   * @param event&lt;br /&gt;
   *            The event.&lt;br /&gt;
   */&lt;br /&gt;
  void Send_actionPerformed(java.awt.event.ActionEvent event) {&lt;br /&gt;
    try {&lt;br /&gt;
      java.net.Socket s = new java.net.Socket(_smtp.getText(), 25);&lt;br /&gt;
      _out = new java.io.PrintWriter(s.getOutputStream());&lt;br /&gt;
      _in = new java.io.BufferedReader(new java.io.InputStreamReader(s&lt;br /&gt;
          .getInputStream()));&lt;br /&gt;
      send(null);&lt;br /&gt;
      send(&amp;quot;HELO &amp;quot; + java.net.InetAddress.getLocalHost().getHostName());&lt;br /&gt;
      send(&amp;quot;MAIL FROM: &amp;quot; + _from.getText());&lt;br /&gt;
      send(&amp;quot;RCPT TO: &amp;quot; + _to.getText());&lt;br /&gt;
      send(&amp;quot;DATA&amp;quot;);&lt;br /&gt;
      _out.println(&amp;quot;Subject:&amp;quot; + _subject.getText());&lt;br /&gt;
      _out.println(_body.getText());&lt;br /&gt;
      send(&amp;quot;.&amp;quot;);&lt;br /&gt;
      s.close();&lt;br /&gt;
    } catch (Exception e) {&lt;br /&gt;
      _model.addElement(&amp;quot;Error: &amp;quot; + e);&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
  /**&lt;br /&gt;
   * Called when cancel is clicked. End the application.&lt;br /&gt;
   * &lt;br /&gt;
   * @param event&lt;br /&gt;
   *            The event.&lt;br /&gt;
   */&lt;br /&gt;
  void Cancel_actionPerformed(java.awt.event.ActionEvent event) {&lt;br /&gt;
    System.exit(0);&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
    &lt;br /&gt;
   &lt;br /&gt;
  &amp;lt;!-- end source code --&amp;gt;&lt;/div&gt;</summary>
			</entry>

	</feed>