condinya
condinya

Reputation: 988

how to create an intranet mailing system using java

i want to create an intranet mailing system using java.so suggest me which API and what classes to use.

Upvotes: 1

Views: 2755

Answers (4)

alexkasko
alexkasko

Reputation: 4925

Try this library: http://github.com/masukomi/aspirin
It can actually send email (some kind of embedded MTA):

public class Main {
   public static void main(String[] args) throws MessagingException {
       MailQue que = new MailQue();
       MimeMessage mes = SimpleMimeMessageGenerator.getNewMimeMessage();
       mes.setText("test body");
       mes.setSubject("test subject");
       mes.setFrom(new InternetAddress("[email protected]"));
       mes.setRecipients(Message.RecipientType.TO, "[email protected]");
       que.queMail(mes);
   }
}

Upvotes: 0

Vasil Remeniuk
Vasil Remeniuk

Reputation: 20617

Without doubts use Apache Commons Email - it's an industry standard.

Commons Email aims to provide a API for sending email. It is built on top of the Java Mail API, which it aims to simplify.

Some of the mail classes that are provided are as follows:

  • SimpleEmail - This class is used to send basic text based emails.
  • MultiPartEmail - This class is used to send multipart messages. This allows a text message with attachments either inline or attached.
  • HtmlEmail - This class is used to send HTML formatted emails. It has all of the capabilities as MultiPartEmail allowing attachments to be easily added. It also supports embedded images.
  • EmailAttachment - This is a simple container class to allow for easy handling of attachments. It is for use with instances of MultiPartEmail and HtmlEmail.


Upvotes: 1

perdian
perdian

Reputation: 2843

Take a look at http://java.sun.com/products/javamail/

Upvotes: 0

romesub
romesub

Reputation: 233

Use the JavaMail API

Upvotes: 0

Related Questions