Driver to email client not working

For my class we are attempting to write our own email client. Our professor gave us the following driver. However when I attempt to compile the driver I get these errors:
MailClient.java:125: cannot find symbol
symbol  : variable envelope
location: class MailClient.SendListener
               SMTPConnection connection = new SMTPConnection(envelope);
                                                              ^
MailClient.java:126: cannot find symbol
symbol  : variable envelope
location: class MailClient.SendListener
               connection.send(envelope);Admittedly it could be something with the SMPTConnection code, as that is what we had to write. However I would have expected it to throw some sort of exception in there and it does not. Any help to figure out why the driver is not working would be appreciatted.
Code:
  import java.io.*;
   import java.net.*;
   import java.awt.*;
   import java.awt.event.*;
/* $Id: MailClient.java,v 1.7 1999/07/22 12:07:30 kangasha Exp $ */
* A simple mail client with a GUI for sending mail.
* @author Jussi Kangasharju
    public class MailClient extends Frame {
    /* The stuff for the GUI. */
      private Button btSend = new Button("Send");
      private Button btClear = new Button("Clear");
      private Button btQuit = new Button("Quit");
      private Label serverLabel = new Label("Local mailserver:");
      private TextField serverField = new TextField("", 40);
      private Label fromLabel = new Label("From:");
      private TextField fromField = new TextField("", 40);
      private Label toLabel = new Label("To:");
      private TextField toField = new TextField("", 40);
      private Label subjectLabel = new Label("Subject:");
      private TextField subjectField = new TextField("", 40);
      private Label messageLabel = new Label("Message:");
      private TextArea messageText = new TextArea(10, 40);
     * Create a new MailClient window with fields for entering all
     * the relevant information (From, To, Subject, and message).
       public MailClient() {
         super("Java Mailclient");
      /* Create panels for holding the fields. To make it look nice,
      create an extra panel for holding all the child panels. */
         Panel serverPanel = new Panel(new BorderLayout());
         Panel fromPanel = new Panel(new BorderLayout());
         Panel toPanel = new Panel(new BorderLayout());
         Panel subjectPanel = new Panel(new BorderLayout());
         Panel messagePanel = new Panel(new BorderLayout());
         serverPanel.add(serverLabel, BorderLayout.WEST);
         serverPanel.add(serverField, BorderLayout.CENTER);
         fromPanel.add(fromLabel, BorderLayout.WEST);
         fromPanel.add(fromField, BorderLayout.CENTER);
         toPanel.add(toLabel, BorderLayout.WEST);
         toPanel.add(toField, BorderLayout.CENTER);
         subjectPanel.add(subjectLabel, BorderLayout.WEST);
         subjectPanel.add(subjectField, BorderLayout.CENTER);
         messagePanel.add(messageLabel, BorderLayout.NORTH);     
         messagePanel.add(messageText, BorderLayout.CENTER);
         Panel fieldPanel = new Panel(new GridLayout(0, 1));
         fieldPanel.add(serverPanel);
         fieldPanel.add(fromPanel);
         fieldPanel.add(toPanel);
         fieldPanel.add(subjectPanel);
      /* Create a panel for the buttons and add listeners to the
      buttons. */
         Panel buttonPanel = new Panel(new GridLayout(1, 0));
         btSend.addActionListener(new SendListener());
         btClear.addActionListener(new ClearListener());
         btQuit.addActionListener(new QuitListener());
         buttonPanel.add(btSend);
         buttonPanel.add(btClear);
         buttonPanel.add(btQuit);
      /* Add, pack, and show. */
         add(fieldPanel, BorderLayout.NORTH);
         add(messagePanel, BorderLayout.CENTER);
         add(buttonPanel, BorderLayout.SOUTH);
         pack();
         show();
       static public void main(String argv[]) {
         new MailClient();
    /* Handler for the Send-button. */
       class SendListener implements ActionListener {
          public void actionPerformed(ActionEvent event) {
            System.out.println("Sending mail");
         /* Check that we have the local mailserver */
            if ((serverField.getText()).equals("")) {
               System.out.println("Need name of local mailserver!");
               return;
         /* Check that we have the sender and recipient. */
            if((fromField.getText()).equals("")) {
               System.out.println("Need sender!");
               return;
            if((toField.getText()).equals("")) {
               System.out.println("Need recipient!");
               return;
         /* Create the message */
            Message mailMessage = new Message(fromField.getText(),
                     toField.getText(),
                     subjectField.getText(),
                     messageText.getText());
         /* Check that the message is valid, i.e., sender and
          recipient addresses look ok. */
            if(!mailMessage.isValid()) {
               return;
         /* Create the envelope, open the connection and try to send
          the message. */
            try {
               Envelope envelope = new Envelope(mailMessage, serverField.getText());
                catch (UnknownHostException e) {
               /* If there is an error, do not go further */
                  return;
            try {
               SMTPConnection connection = new SMTPConnection(envelope);
               connection.send(envelope);
               connection.close();
                catch (IOException error) {
                  System.out.println("Sending failed: " + error);
                  return;
            System.out.println("Mail sent succesfully!");
    /* Clear the fields on the GUI. */
       class ClearListener implements ActionListener {
          public void actionPerformed(ActionEvent e) {
            System.out.println("Clearing fields");
            fromField.setText("");
            toField.setText("");
            subjectField.setText("");
            messageText.setText("");
    /* Quit. */
       class QuitListener implements ActionListener {
          public void actionPerformed(ActionEvent e) {
            System.exit(0);
   }

This is what I mean:
/* Create the envelope, open the connection and try to send the message. */
           Envelope envelope = null;
            try {
                 envelope = new Envelope(mailMessage, serverField.getText());
                catch (UnknownHostException e) {
               /* If there is an error, do not go further */
                  return;
            try {
               SMTPConnection connection = new SMTPConnection(envelope);
               connection.send(envelope);
               connection.close();
                catch (IOException error) {
                  System.out.println("Sending failed: " + error);
                  return;
            System.out.println("Mail sent succesfully!");

Similar Messages

  • Email is not working properly and dvr is freezing.

    I never thought I would say this but I am considering going back to cable. I have been calling verizon for 2 weeks now. My email is not working. I did not get any email for about 3 days, then when I called I got a couple (I normally get about 70 per day). Now I get 3 or 4 a day and it seems I have to call them daily. Their server is rejecting emails. I have many things I am waiting for (business contracts, etc) and I am not getting them. CLients are telling me that their emails are being rejected by verizons servers. I am not getting any answers from verizon. All that happens is when I complain, I get email for about an hour (sporadically) and then it stops again. I have really had enough of it at this point. And the DVR freezing for the last several months.. well that is another issue. It is time to look into optimum again

    Hi mooster --  I sent you a private message so I can get some more information about the problems you're having and so we can figure out what's going on.  Please get back to me when you're able.  Thanks!
    Karl
    Verizon Support
    Notice: Content posted by Verizon employees is meant to be informational and does not supersede or change the Verizon Forums User Guidelines or Terms or Service, or your Customer Agreement Terms and Conditions or Plan.

  • Exchange email will not work when offline

    Anyone know when Apple will fix this issue?  Email will not work correctly unless connected to wireless.  This makes it impossible to be productive while flying.  This is exclusive to exchange servers as it woks on POP accounts.  

    I know that.  When I work on my laptop I can file, reply, delete etc. and when I land it updates all the folders and sends and recevies all the mail.  the iPad will not let you file or delete emails unless connected.  This makes flying time completely unproductive.  If I have to have a laptop to do email why have an iPad???

  • My iCloud email does not work. Getting error message that i need to uncheck SSL . This does not work. Help

    icloud Email does not work. When running Connection doctor it indicates I must check or uncheck SSL. This has not fixed the problem

    iCloud email addresses (@mac.com, @me.com and @icloud.com) require SSL. Is your address an iCloud address or someone else?

  • My icloud email is not working on any of my devices (pc, iphone, ipad).  For 2 days now.    Any suggestions?

    My icloud email is not working on any of my devices (iphone 4s, ipad, pc).   For 2 days now.    Any suggestions?

    I have the same problem.  I called Apple this morning, they told me that they restored "half" of the people affected last night and the next update will be 11 am EST.  Very frustrating to say the least!

  • HT4623 My iPhone4s updated to 7.1.1 and now my internet and email is not working. I need help?

    Sorry, I'm new to this, I installed IOS 7.1.1 on my iPhone 4s and now my internet and email is not working. 
    I have googled this on my computer and can't find any reference to this sort of problem.
    I need help. 
    Thanks in advance. 

    Try this:
    Go to Settings > General > Reset > Reset Network Settings
    See if you are able to connect now.

  • Hello everybody,i've forgot my apple password and i wanted to reset it to a new one but i also forgot the security question and the alternative email does not work and i am really need to log in to my apple i d because my iPhone 4g won't  let me access it

    Hello everybody,i've forgot my apple password and i wanted to reset it to a new one but i also forgot the security question and the alternative email does not work and i am really need to log in to my apple i d because my iPhone 4g won't  let me access it so anyone can help me with it or can i put another apple id to it without putting the first password?THANKS FOR YOUR HELP.

    Then call AppleCare and talk to someone in account security.

  • Share option for email does not work after Yosemite upgrade.

    Hi,
    Does anybody know why the share option, "Share via email" does not work anymore after Yosemite upgrade?  I love this feature.  It's just quick and easy.
    Rod.

    On Yosemite, Pages '09 v4.3 no longer recognizes the Share > Send Via Email categories. You will have to export and manually drag/drop/attach documents to Mail. There is no fix.

  • I cannot seem to load raw images into LR 2.5.  I've been using this for years.  I always load from memory card, but it gives me an unknown error message.  I tried to load from camera, hard drive, & external drive and still will not work.  I checked import

    I cannot seem to load raw images into LR 2.5.  I've been using this for years.  I always load from memory card, but it gives me an unknown error message.  I tried to load from camera, hard drive, & external drive and still will not work.  I checked import menu and nothing has changed.  I loaded the photos onto my tablet and images are fine, so do not feel it is the memory card.  Any thoughts?

    The error message probably said "unsupported or damaged"
    The T3 requires Lightroom 3.4.1 or later. You can either upgrade to a more current version of Lightroom (version 5.6 is the most recent) or you can use the free Adobe DNG Converter to convert the RAWs to DNG, which should import into Lightroom properly.

  • Can't sync ical on my iphone and imac. email and note work but not ical.  can anyone help.

    can't sync ical on my iphone and imac. email and note work but not ical.  can anyone help.
    thanks
    bmoreimac

    So how can i make it work that way, i asked one of my friends, and she says it works like that...when she delete the email on her iphone it is deleted on the mac too, what do i do to change this?....my mail it's hotmail, i don't know if its relevant

  • I called Verizon prior to travelling abroad and asked to turn roaming on. As of today, 4 days later, I have no service. I do not have a landline to call. GlobalServices email does not work... Does anybody know how to reach customer support via email?

    I called Verizon prior to travelling abroad and asked to turn roaming on. As of today, 4 days later, I have no service. I do not have a landline to call support. GlobalServices email does not work... Does anybody know how to reach customer support via email?

        Hi Florence2014
    I'm so sorry your having issues. Unfortunately there isn't an email for global support. The only way way to reach them while traveling is to call them at 908-559-4899.
    JoeL_VZW
    Follow us on Twitter @VZWSupport

  • TS3276 my server went down and now my email is not working, can anyone help please?

    My website server went down and now my email is not working (though the server is back up)
    Does anyone know what I need to do?
    I'm told by my website hosts that I need to 'reconfigure authentication" but I have no idea how to do this, they are now closed for the weekend and I need it fixed before Monday morning. Could anyone tell me where to find step by step instructions. I've tried but have made matters worse and the couple of mail accounts that WERE still receiving email are now also not.
    Help please!

    Hi Eyen80,
    If you are having issues with your iPhone’s camera not functioning, you may want to troubleshoot using the steps in this article -
    iPhone: Hardware troubleshooting
    http://support.apple.com/kb/TS2802
    Specifically -
    Camera isn't functioning or has undesired image quality
    If the screen shows a closed lens or black image, force quit the Camera app.
    If you do not see the Camera app on the Home screen, try searching for it in Spotlight. If the camera does not show up in the search, check to make sure that Restrictions are not turned on by tappingSettings > General > Restrictions.
    Ensure the camera lens is clean and free from any obstructions. Use a microfiber polishing cloth to clean the lens.
    Cases can interfere with the camera and the flash. Try gently cleaning the lens with a clean dry cloth or removing the case if you see image or color-quality issues with photos.
    Try turning iPhone off and then back on.
    Tap to focus the camera on the subject. The image may pulse or briefly go in and out of focus as it adjusts.
    Try to remain steady while focusing:
    Still images: Remain steady while taking the picture. If you move too far in any direction, the camera automatically refocuses to the center.
    Note: If you take a picture with iPhone turned sideways, it is automatically saved in landscape orientation.
    Video: Adjust focus before you begin recording. You can also tap to readjust focus while recording. Exiting the Camera application while recording will stop recording and will save the video to the Camera Roll.
    Note: Video-recording features are not available on original iPhone or iPhone 3G.
    If your iPhone has a front and rear camera, try switching between them to verify if the issue persists on both.
    Thanks for using Apple Support Communities.
    Best,
    Brett L

  • Ethernet driver for WXP is not working on Satellite A100

    Satellite A100-784 PSAANE-02L011G3 ethernet driver for wxp is not working. Can not properly install driver, downloaded all possible drivers and still not working.
    In device manager yellow sign. I have bought my laptop with Vista BASIC and I put XP-SP2. Country is Croatia! Help me please!

    Hi
    I cannot believe that you are not able to install the LAN driver on this A100 Satellite!
    However, the Sat A100-784 supports an Intel 82562GZ 10/100 Mbit (Ekron) Lan chip.
    If you want you can download and install the Lan driver from the Intel page:
    http://downloadcenter.intel.com/Product_Filter.aspx?ProductID=999&lang=eng
    There you will find the drivers for the Intel 8256x Ethernet Controllers
    Bye

  • I create cloud ID long time ago. My cloud ID is email. This email is not working now. I cant check inbox. How I can reset password in this case?

    I create cloud ID long time ago. My cloud ID is email. This email is not working now. I cant check inbox. How I can reset password in this case?

    https://appleid.apple.com

  • Cableone innstalled a new server and now my thunderbird email will not work. What do I do now?

    Cableone, our internet provider, has changed from a Google server to their own server and now my Thunderbird email will not work. They have directions listed to make it work, but this does not work. I have also contacted Cableone's technical support and they say because thunderbird is not their system they have no responsibility to make it work. I prefer to use Thunderbird for my email - how can I make it work? Also, I have tried the Thunderbird 'Automatic Account Configuration' help and it does not work.

    Ask your less than helpful provider for the server settings and setup the new account up manually.
    You want to know IMAP or POP and the name of the server. The port number and if it uses SSL/TLS security.
    You need the same info for the SMTP server for outbound mail.

Maybe you are looking for

  • Overlapped I/O error installing SQL Server Express 2014 on Win 8.1

    Hi, I'm attempting to install SQL2014 on a SurfacePro3 running Win 8.1.  Despite much searching I've not found anything that gets me past this problem. I've tried: Uninstalling a update KB2918614 which was highlighted as a potential issue The login i

  • Serious problem!!

    I've been using the same apple ID for many years but I've stopped using the email address used for it so I decided to update it to my current email, I did this but now however when I try to sign in on my iPad it says 'this apple ID has not yet been u

  • HT1491 In apps purchasing.

    Guys, when i am trying to buy somthing from ( in app. Purchasing) it give me a message says contact apple support for assistance. All my information are correct.

  • Automatically renewing certificates for digital signatures

    Is it possible to setup some form of system that automatically renews the user certificate for digital signatures? If so, where can i find information on this?

  • IMac with gray screen (one seen during display not the one with an apple)

    I have an imac with a gray screen (not the gray screen with apple that you get for hard drive/motherboard trouble) Someone said it may be the video card but Idk if that is right. Let me know if you can help! Thanks!