Logo 
Search:

Java Forum

Ask Question   UnAnswered
Home » Forum » Java       RSS Feeds

source code for intranet e-mailing system using javaq

  Asked By: Kiswar    Date: Jan 23    Category: Java    Views: 6575
  

Did anyone of you have the source code for intranet e-mailing system
using java?If anyone have the source code ,will you plz send it to me
or suggest me any websites that contain the source code.

Share: 

 

4 Answers Found

 
Answer #1    Answered By: Wade Jordan     Answered On: Jan 23

Please go to www.java2s.com web site.
You will get lot of java e-mail examples.
Download http://www.java2s.com/Code/JavaDownload/JavaMailWebBased.zip this zip
file
and configure all the jar files and java source  files in Eclipse.

 
Answer #2    Answered By: Roderick King     Answered On: Jan 23

Iam sending the links where u can get the source  code..examples..read javamail
api and then start working..it is very easy..u can do the coding in 1day if u
thoroughly read.

www.roseindia.net/.../...age-using-java-mail.shtml
www.roseindia.net/javamail/

 
Answer #3    Answered By: Fatih Farooq     Answered On: Jan 23

I think this code  help you for e-mailing  system



To compile and run, you must have mail.jar (from the JavaMail download) and
activation.jar (from the JavaBeans Activation Framework download) in Java
classpath.

You need to replace email addresses and mail server with your values where
noted.
Username and password is generally not needed to send  e-mail although
your ISP may still require it to prevent spam from going through its
systems.
This sample code has debugging turned on ("mail.debug") to see what is going on
behind the scenes in JavaMail code.import java.util.*;
import javax.mail.*;
import javax.mail.internet.*;
import javax.activation.*;

// Send a simple, single part, text/plain e-mail
public class TestEmail {

public static void main(String[] args) {

// SUBSTITUTE YOUR EMAIL ADDRESSES HERE!!!
String to = "abc@...";
String from = "abc@...";
// SUBSTITUTE YOUR ISP'S MAIL SERVER HERE!!!
String host = "smtp.yourisp.net";

// Create properties, get Session
Properties props = new Properties();

// If using static Transport.send(),
// need to specify which host to send it to
props.put("mail.smtp.host", host);
// To see what is going on behind the scene
props.put("mail.debug", "true");
Session session = Session.getInstance(props);

try {
// Instantiatee a message
Message msg = new MimeMessage(session);

//Set message attributes
msg.setFrom(new InternetAddress(from));
InternetAddress[] address = {new InternetAddress(to)};
msg.setRecipients(Message.RecipientType.TO, address);
msg.setSubject("Test E-Mail through Java");
msg.setSentDate(new Date());

// Set message content
msg.setText("This is a test of sending a " +
"plain text e-mail through Java.\n" +
"Here is line 2.");

//Send the message
Transport.send(msg);
}
catch (MessagingException mex) {
// Prints all nested (chained) exceptions as well
mex.printStackTrace();
}
}
}//End of class

 
Answer #4    Answered By: Arnelle Schmidt     Answered On: Jan 23

It should be the same as internet mailing system.. :-)

Only diff woould be in run time environment..that is your mail server will
be accessible within you Local network..
Of course you would be using Java Mail API.. and you can get the same code
very easily.

Let us know in case of any problem further..

 
Didn't find what you were looking for? Find more on source code for intranet e-mailing system using javaq Or get search suggestion and latest updates.




Tagged: