Results 1 to 4 of 4
  1. #1
    DigitalBoB12 is offline Member
    Join Date
    Apr 2008
    Rep Power

    Default Simple Java Mail Client

    Hello Java community. I am taking an intro to java course and have run into a bunch of trouble towards the end. Our teacher has barely taught us anything about networking, or anything else for that matter lol, but he wants us to work on creating a java mail client. My friends and I have been working for sometime on this but have not gotten very far. We have searched online, through our textbook, and spoke to others and still are having trouble. I was wondering if you could give us any help. We also have not been taught on netbeans much, which he popped out of nowhere last class and said we had to use for a graphic interface. here is the hw question:

    Design a mail client which will allow us to send one message while detecting any error that may occur during the process and telling the user. The screen shoudl have fields for SMTP server, Sender's email address, recipient's email address, and a text area for the body of the message.

    SMTP usually uses port 25 for mail. You may provide an input box to override this default, though it's not necessary.

    A transcript of a normal session is below:
    220 ESMTP Sendmail 8.13.1/8.13.1; Wed, 16 Apr 2008 20:25:59 -0400 (EDT)
    HELO dkatz
    250 Hello dkatz@localhost [], pleased to meet you
    mail from:<>
    250 2.1.0 <>... Sender ok
    rcpt to:<>
    250 2.1.5 <>... Recipient ok
    354 Enter mail, end with "." on a line by itself
    Subject: This is a test message

    250 2.0.0 m3H0PxPp025632 Message accepted for delivery

    You can try this yourself, by executing "telnet (mailserver) 25" in a command window.

    -Any help would be much appreciated. Snippets of code, advice, or even the whole thing would be very helpful so that i can sort of "reverse engineer" it and see what has been done as i am very lost.

  2. #2
    Eranga's Avatar
    Eranga is offline Moderator
    Join Date
    Jul 2007
    Colombo, Sri Lanka
    Blog Entries
    Rep Power

  3. #3
    Johnny Kewl is offline Member
    Join Date
    May 2008
    Rep Power


    You just got lucky... go here and steal that code... dont worry about the server, just take that code and get it compiled
    Its not perfect but it does what you need.
    As Eranga said its Javamail, but what you learning.. ie the smtp protocol is also a good thing, thats whats happening underneath Javamail... and Eranga, I got to tell you, if thats you, I think I'm in love ;)

  4. #4
    vglass is offline Member
    Join Date
    Jul 2007
    Rep Power


    The SMTP protocol for sending a message is pretty simple. You could use the JavaMail framework or just do a Google search for "Java SMTP". Plenty of results available.

    Either way, to really understand you should look at RFC 821 which describes the protocol.

Similar Threads

  1. a problem about java mail client program
    By lunarstyle in forum AWT / Swing
    Replies: 9
    Last Post: 12-19-2009, 05:14 PM
  2. A Client to Send SMTP Mail
    By Java Tip in forum
    Replies: 0
    Last Post: 04-07-2008, 09:06 PM
  3. Replies: 3
    Last Post: 01-07-2008, 08:01 AM
  4. Access Email usind a java mail client Access Email usind a java mail client
    By consult4u in forum Enterprise JavaBeans (EJB)
    Replies: 2
    Last Post: 07-31-2007, 09:29 AM
  5. Simple example Client Server Application
    By ferosh in forum Networking
    Replies: 1
    Last Post: 04-01-2007, 11:36 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts