Solved

Java Email

Posted on 1998-06-29
3
186 Views
Last Modified: 2013-11-24
We have Java Email specification?
There is no tutorial for Java email? how to implement Email service in Java.?
0
Comment
Question by:geostp
  • 2
3 Comments
 
LVL 6

Accepted Solution

by:
gadio earned 50 total points
ID: 1224122
geostp, if you want the complete srevices of pop3 protocol, you had better download one of the many free pop3 packages that are on the net. For example try: http://members.tripod.com/~mpandit/POP3download.html
If however all you want to do is send email using java, you may want to use the SMTP protocol. You can implement the protocol yourself (if you need more information ask), and you can use internal java classes. These classes are not documented but they work ok. Here is the info for using the internal class (use import) sun.net.smtp.SmtpClient :
public synchronized class SmtpClient extends TransferProtocolClient
{
    String mailhost;
    SmtpPrintStream message;
    public SmtpClient()
    public SmtpClient(String string)
    public void closeServer()
    public void from(String string)
    public String getMailHost()
    public PrintStream startMessage()
    public void to(String string)
}

Use the constructor with the url of the mail server. fill the from and the to (through the functions), use the startMessage to get a printstream, to which you write the mail, and finally use the closeServer() to send.
Good luck,
G.
0
 
LVL 6

Expert Comment

by:gadio
ID: 1224123
If you need more info feel free to ask.
0
 

Expert Comment

by:jorgenlindell
ID: 1224124
smtp and POP3 classes are free at my hompage at lgr.se
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now