Developed Complete Mail System

Hi All

I have completed the whole Email System by using the Java Mail API's.

It has the features like, Send, Recieve, Multiple Folders, HTML Composing, Block Sender, Sorting, Filters, Address Book, etc.

If any java programmer wants help on Javamail then mail me at.

webchella@hotmail.com

Regards

[369 byte] By [webchella] at [2007-9-26 3:14:26]
# 1
Thanks for Starting another Spam list....Arent u guys ashamed? If u really had such a thing u wud have posted the URL of the source code and not want others to mail you!!!!!!!
ossidon at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
I am not going to give source code to any one.i just want to help students, as i faced a lots of problems in building it.Thats why i write if anyone have problem, then discuss that problem with me, dont ask for source code.
webchella at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 3
Oh dear I am also developing the mail system using JavaMail API. Firstof all you tell me what is the java mail api class supporting smtp.2. then tell me what Mailserver i use for mail storage. My supervisor tell me to use Microsoft Exchange Server 2000. Is it OK or not.
AbidM at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 4
Oh dear I am also developing the mail system using JavaMail API. Firstof all you tell me what is the java mail api class supporting smtp.2. then tell me what Mailserver i use for mail storage. My supervisor tell me to use Microsoft Exchange Server 2000. Is it OK or not.
AbidM at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 5
Oh dear I am also developing the mail system using JavaMail API. Firstof all you tell me what is the java mail api class supporting smtp.2. then tell me what Mailserver i use for mail storage. My supervisor tell me to use Microsoft Exchange Server 2000. Is it OK or not.
AbidM at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 6
Well, your instructor's choice is Ok.You may also use the Imail sevrer, trail downloadable from the www.ipswitch.com/Products/IMail_Server
webchella at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 7

Dear webchella

I just started using javamail, i am able to succesfully send mail , but the problem is in retriving mail,

I am getting "There is no replica for that mailbox on this server" error,

Here is the code i am using

Properties props = System.getProperties();

Session session = Session.getDefaultInstance(props, null);// Get session

session.setDebug(true);

Store store = session.getStore("imap");

store.connect(host, username, pwd);

Folder folder = store.getFolder("INBOX");

folder.open(Folder.READ_ONLY);

Message message[] = folder.getMessages();

System.out.println(1 + ": " + message[1].getFrom()[0] + "\t" + message[1].getSubject());

System.out.println(message[1].getContent());

folder.close(false);

store.close();

Thanks in advance

Sravanti

ssravanti at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 8

I have a problem with the program below. I ran the same code on two(2)

different machine. One is running okay and the other machine, I got the

error below.

Microsoft(R) Windows NT(TM)

(C) Copyright 1985-1996 Microsoft Corp.

C:\>set classpath

CLASSPATH=C:\Sybase\ASEP\Monclass.zip;C:\Sybase\ASEP\3pclass.zip;.;D:\extracts\c

lasses;c:\sybtools\ASEP\Monclass.zip;c:\sybtools\ASEP\3pclass.zip;D:\SQLLIB\java

\db2java.zip;D:\SQLLIB\java\runtime.zip;d:\extracts\classes\FTPProtocol.jar;d:\e

xtracts\classes\mail.jar;d:\extracts\classes\activation.jar;d:\JBuilder4\jdk1.3\

jre\lib\rt.jar;d:\JBuilder4\jdk1.3\lib\tools.jar;d:\JBuilder4\jdk1.3\lib\dt.jar;

d:\jsdk\lib\jsdk.jar;d:\extracts\classes\smtp.jar;d:\extracts\classes\pop3.jar;d

:\extracts\classes\mailapi.jar;

C:\>javac SendMessage.java

C:\>java SendMessage dortiz@ustrust.com dortiz@ustrust.com

javax.mail.SendFailedException: Sending failed;

nested exception is:

javax.mail.MessagingException: IOException while sending message;

nested exception is:

javax.activation.UnsupportedDataTypeException: no object DCH for MIME ty

pe text/plain; charset=us-ascii

at javax.mail.Transport.send0(Transport.java:219)

at javax.mail.Transport.send(Transport.java:81)

at SendMessage.main(SendMessage.java:40)

Here's my code.

import java.util.*;

import javax.mail.*;

import javax.mail.internet.*;

import javax.activation.*;

public class SendMessage

{

public static void main(String args[]) {

if (args[0] == null) {

System.out.println("from email, parameter(1) is blank");

}

if (args[1] == null) {

System.out.println("to email, parameter(2) is blank");

}

String from = args[0];

String to = args[1];

String mailServer = "ustjc3notes6.ustrust.com";

java.util.Properties properties = System.getProperties();

properties.put("mail.host", mailServer);

properties.put("mail.transport.protocol", "smtp");

Session session = Session.getDefaultInstance(properties, null);

try {

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(from));

message.setRecipients(Message.RecipientType.TO,

InternetAddress.parse(to, false));

message.setSubject("Test");

message.setText("Test Mail");

Transport.send(message);

}

catch(MessagingException mex) {

mex.printStackTrace();

}

} // end void main

}

bongortiz at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 9
hello,can you send me about javamail system?thanks!!!!
meixiaolong at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 10

hi,

can u please tell me how u r managing with folders.

I want to create user defined folders for sent items,draft items and any folder which user wishes to create.

Can u please tell me how u r managing with this things.

Thanks in advance

Santhosh

sunthosh@asthatech.com

sunthosh_p at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 11
while displaying a message using javamail, i am unable to get the attached file name. it just shows 'filename'. can u resolve this.
aiysha1 at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 12

helo webcella

i m havin prob in forwarding the message

first i add the current mail content to bodypart

and after that the previous content to the bodypart

After creatin the whole different body part

i add this bodyparts to the mutipart and add the

multipart to the message.

but i m not gettin the current as well as previous stufff in the message

neway i just tried to check that my multipart content the added bodyparts correctly or not before sendin the mail, i got the correct stuff which i added

wht the prob ?

u can mail me at sharad@phoenixsoftech.com

sharadsorate at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 13
Hello Friend,I've written the INBOX code. I am using pop3 mails with pop.mail.yahoo.com.I am not able to retrive the flags - RECENT or SEEN.Please help me outYou can mail me at d_unmesh2k@yahoo.com ThankxUnmesh
d_unmesh2k at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 14

hi..

i am also working on javamail and is currently making a email system ..

there are some problems which i am facing..

i am using IMail server...

i want to implement this AddUser in MailSystem...

(like in Rediff, Yahoo...)

but i dont know how to do that... throughMy Web Interface...

I dont know how to interact with adduser.exe in Imail Server(which allows to add new users)..

From my search what i have learned is that to interact with this .exe file you will need socket programming...

i dont know whether this is correct method of doint this...

plz help

and if you can give me your mail address

thanks...

gurpreet_gh761230 at 2007-6-29 11:24:41 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 15
Hello! I want this system,pls send to me javamail Source code,, Thanks in advance cotact me to :dhwyx@163.comterence
dhwyx at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 16

hi ,

i'm very new to java mail. now i'm planning to develop a mail application using javamail package.

i'm using java webserver and working on NT platform. i've java mail & activations packages. but my problem is what mail server can be better for this environment. and how to setup the mail server to send and recieve mails. please help me.

Is there any free mail server available?

please reply me.

regards,

venu

venuchanda at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 17

HI All

To tackle with the problem of creating users is very easy in Imail server.

Store all the users information in the database that support DSN. (i used SQL Server).

Now thier is an options in the Admin section of Imail server where u specify the type of users storage.

It supports 3 types, one is to let Imail store user information , second is to point Imail server to use the DSN.

Select this option then create user through coding and insert info in database. And Imail automaically updates user information through DSN.

Regards

webchella

webchella at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 18

Hi webchella,

I am also using IMail server. In the admin of Imail, I am choosing a virtual host. There I could see 3 options. 1)Imail Database 2)NT Database3)External Database.

I am choosing the third option and then I clicked on the 'configure' button. Then in the next dialog box, I entered the following details

1) External Database Implementation DLL :- C:\Imail\ODBCUSER.DLL

2) ODBC System Data Source Name :- IMAILSECDB( This DSN is configured in ODBC)

3) Table Name :- emailusers (columns are the same as instructed by IMAIL)

and clicked on OK.

But when I insert a new record, nothing happens. Meaning, I can not see any user added in that particular Virtual Host. Neither it can be authenticated by the IMAIL web interface.

When I am creating users manually(using IMail Database ), It works with Imail web interface as well as the web-mail application made by me.

Please help me out

Regards

Unmesh

d_unmesh2k at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 19

Hi I'm currently using JavaMail and it was working fine all along.

Now I get this stupid error : org.apache.jasper.JasperException: Unable to compile class for JSPC:\TogetherSoft\Together6.0\myprojects\OriginWebSite\work\localhost_8080\_0002fapp_0005fsendmail_0002ejspapp_0005fsendmail_jsp_0.java:16: Package javax.activation not found in import.

import javax.activation.*;

I imported all the .jar files needed.

Please help.

Rebel_INS at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 20
You will need to download the JAF (Java Activation Framework) from java.sun.com/products and you'll need to add activation.jar file in your CLASSPATH
d_unmesh2k at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 21
Hi Unmesh You aer commiting a basic mistake. Your Table name should be the same as in the Imail database. I think it should be "MembersDB".Try this;RegardsIshraq
webchella at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 22

Hi,

I am learning to send a mail using SmtpClient. I am getting following expception when I try and send the mail through. Could it be because of some security settings on the SMTP server?

java.net.UnknownHostException: mailhost

at java.net.InetAddress.getAllByName0(InetAddress.java:571)

at java.net.InetAddress.getAllByName0(InetAddress.java:540)

at java.net.InetAddress.getByName(InetAddress.java:449)

I have the name of the SMTP server and also have the IP address. I can ping the SMTP server using the name. I still do not understand what is the problem. I have set the internet option to exclude internal servers from going through the firewall. So it should behave as if there was no firewall. DO you think there may be other security setup on the SMTP server?

Thanks in advance

R

zznqnt at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 23

Hi There!,

I already done all the email apps too like sending, receiving, attachments, etc..

everything except I couldn't create folders besides inbox.. could you post a sample code in creating folders.. I know that you can't create folder in POP3 but you can in IMAP.. So could you post a sample of how to "create", "delete","access", and "move a message from one folder to another..

Thanks! or you can email me at junestefa@hotmail.com

BTW, Can you handle all the type of email.. my email is almost perfect but there are some still rare email that I can't handle. But i'll tell you my problem next time i'm just asking if you were able to extract all type of emails.. it seems there are many of them..

junestefa at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 24
do u have a solution to create user account online
swarsiw at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 25
please tell me the bsic thing about starting email systemalso tell me about subscribe.unscribe system
azizmalik at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 26

I have used the below code to send a mail using javamail API?Even when I am sending a mail using my application,it does not have notified any error/exceptions,But the message is not received at the receipient's address .pls below code I have used to send mails from rediffmail as hostname

import javax.mail.*;

import javax.mail.internet.*;

import javax.activation.*;

import javax.servlet.*;

import javax.servlet.http.*;

import java.io.*;

import java.util.*;

public class Sendmail1 extends HttpServlet {

private String smtpHost;

// Initialize the servlet with the hostname of the SMTP server

// we'll be using the send the messages

public void init(ServletConfig config)

throws ServletException {

super.init(config);

smtpHost = config.getInitParameter("smtpHost");

//smtpHost = "sbm5501";

smtpHost = "www.rediffmail.com";

}

public void doGet(HttpServletRequest request,HttpServletResponse response)

throws ServletException, java.io.IOException {

String from = "kmaheshbe@rediffmail.com";

String to "mahesh_2000_kk@yahoo.com";

String cc = "umathangavel@hotmail.com";

String bcc ="vinuemmanuel@mailcity.com";

String smtp ="www.rediffmail.com";

String subject = "hai";

String text = "Hai how r u";

PrintWriter writer = response.getWriter();

if (subject == null)

subject = "Null";

if (text == null)

text = "No message";

String status;

try {

// Create the JavaMail session

java.util.Properties properties = System.getProperties();

if (smtp == null)

smtp = "www.rediffmail.com";

properties.put("mail.smtp.host", smtp);

Session session = Session.getInstance(properties, null);

//to connect

//Transport transport =session.getTransport("smtp");

//transport.connect(smtpHost,user,password);

// Construct the message

MimeMessage message = new MimeMessage(session);

// Set the from address

Address fromAddress = new InternetAddress(from);

message.setFrom(fromAddress);

// Parse and set the recipient addresses

Address[] toAddresses = InternetAddress.parse(to);

message.setRecipients(Message.RecipientType.TO,toAddresses);

Address[] ccAddresses = InternetAddress.parse(cc);

message.setRecipients(Message.RecipientType.CC,ccAddresses);

Address[] bccAddresses = InternetAddress.parse(to);

message.setRecipients(Message.RecipientType.BCC,bccAddresses);

// Set the subject and text

message.setSubject(subject);

message.setText(text);

Transport.send(message);

//status = "<h1>Congratulations,</h1><h2>Your message was sent.</h2>";

} catch (AddressException e)

{

status = "There was an error parsing the addresses. " + e;

} catch (SendFailedException e)

{

status = "<h1>Sorry,</h1><h2>There was an error sending the message.</h2>" + e;

} catch (MessagingException e)

{

status = "There was an unexpected error. " + e;

}

// Output a status message

response.setContentType("text/html");

writer.println("<title>sendForm</title><body bgcolor=><b><h3><font color=green><CENTER>CALIBERINFO.COM</CENTER></h3>Your message was sent to recepient(s).

<font color=red>"+"\n"+to);

writer.println("

<a href=e:/mail/javamail/mail.html>back to compose</a>");

writer.close();

}

}

Please any one help me out from this probs.

Awaiting for yours reply,

or give me a reply to: kmaheshbe@rediffmail.com

Regards,

@maheshkumar.k

mahesh77us at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 27

Hi,

I am using java mail to read the new messages from INBOX. But iam encountyered wiith error. I clound not find the solution for thos. Could you please help me.

Thnaks

Sudhakar

Error Message

C:\mail>java NewMail

Exception in thread "main" javax.mail.NoSuchProviderException: No provider for pop3

at javax.mail.Session.getProvider(Session.java:249)

at javax.mail.Session.getStore(Session.java:323)

at javax.mail.Session.getStore(Session.java:303)

at NewMail.main(NewMail.java:17)

Source code is

import javax.mail.*;

import javax.mail.internet.*;

public class NewMail {

public static void main (String args[])

throws Exception {

//,"smtp.freeserve.net"

String host = "pop.freeserve.net";

String username = "xxx@konda.freeserve.co.uk";

String password = "xxx";

// Get session

Session session = Session.getInstance(

System.getProperties(), null);

// Get the store

Store store = session.getStore("pop3");

store.connect(host, username, password);

// Get folder

Folder folder = store.getFolder("INBOX");

folder.open(Folder.READ_ONLY);

// Get Count

int count = folder.getMessageCount();

System.out.println("Messages waiting: "

+ count);

count = folder.getUnreadMessageCount();

System.out.println("Unread messages waiting: "

+ count);

// Close connection

folder.close(false);

store.close();

}

}

ksreddy123 at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 28

Can I get the source code for the application.

Iam interested in Sorting,Folder,Filter,AddressBook,Search

features. Does ur application need any database to store

the messages. Iam using IMAP in my application.

You can contact me at - dalavamurali@hotmail.com

Awaiting your response.

Thanks,

Murali Mohan

dalavamurali at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 29

Sravanti - I see that about 1.5 years ago you had a problem when trying to use the JavaMail API to retrieve messages from an Exchange mailbox: "A2 NO There is no replica for that mailbox on this server". I am getting that same problem - did you resolve that issue? What was the problem?

Any help would be greatly appreciated.

-clint

clintgrady at 2007-7-1 3:33:13 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 30

i used the following code for mailing a message..it is working..the problem is that what if i dont know the SMTP of the recipient i am mailing as there are so many servers.

import java.util.Properties;

import javax.mail.*;

import javax.mail.internet.*;

public class MailExample {

public static void main(String args[])throws Exception{

String host = args[0];

String from = args[1];

String to = args[2];

//Get System Properties

Properties props = System.getProperties();

//Setup mail server

props.put("mail.smtp.host",host);

//Get Session

Session session = Session.getDefaultInstance(props,null);

//Define Message

MimeMessage message = new MimeMessage(session);

//Set the from address

message.setFrom(new InternetAddress(from));

//Set the to address

message.addRecipient(Message.RecipientType.TO,new InternetAddress(to));

//Set the subject

message.setSubject("Hello Javamail");

//Set the content

message.setText("Welcome to JavaMail");

//Send Message

Transport.send(message); }}

iv99 at 2007-7-1 3:33:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 31

hi webchella,

i have to develop a complete email system

for my college project and i have another month to complete it and i'm really stuck, my programing skills is quite bad. I have to use jsp and mysql on apache tomcat. It took me alot time setting up apache tomcat in xp i faced many problems.I've downloaded james as my mail server. I have a few question to ask is :

1) how is the process of a user signing to the system and retrieving his mails.

2) When a users signs in does the user have a session id..

3) where can i find codes that can help me do this

4) i created i registration page why is the javascript not validating the data entered..

i hope u can provide some information about this.. thanks... it will be very helpful if can provide answers to this questions..

ice_dave at 2007-7-1 3:33:14 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 32

Hi

i'm trying to create an E-mail client with spam filters using Javamail.Till now i can sent and receive email with attachments.I have an addressbook and a text editor.At the moment i'm trying to create the main screen with folders (mailbox,sent messages,deleted messages,etc..),a message viewer and a folder viewer(see the email inside the folder when you click on a folder).I used JSplitPanel to display these screens but i have many problems to make them work correctly.For example when i receive an email with POP or IMAP to store it directly to the inbox folder and when i send a mail to store it to the sent messages folder.Above all that i have more problems with the spam filters, how will i make them check everyemail that i receive? I tried everything but i can't find a solution.

Thanks and sorry about the long message.

Johnpp at 2007-7-1 3:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 33

Hi,

I am writing one program which can send mail.

But I am getting the error while executing it.

Here is the erroR

javax.mail.NoSuchProviderException: No provider for Address type: rfc822

at javax.mail.Session.getTransport(Session.java:516)

at javax.mail.Transport.send0(Transport.java:155)

at javax.mail.Transport.send(Transport.java:81)

at SimpleSender.send(SimpleSender.java:91)

at SimpleSender.main(SimpleSender.java:32)

error is coming while i program trying to execute the line

Transport.send(msg);

Plz Help me...

Regards

Seema

seema_splash at 2007-7-1 3:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 34

Hi,

I am new Java Programer, I have the Project now like you do.

can you help me and send me some sample code of your Mail system.

I need read and send Email with various Email Server like Outlook, Groupwise and Lutos Notes Domino Server. I have to program this with JavaMail.

It is also very important to open and use Addressbook.

Can you give me tip or same sample Code?

Regards

Zhentao

zsjava at 2007-7-1 3:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 35
Help requiredon authentication and html as bodyThanks in advance
sherrymks at 2007-7-1 3:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 36

Hi . I am also having the same problem. My yahoo accout cosmosoftweb503@yahoo.co.in is supportng POP3 and SMTP access.This i have enabled from settings option of the Yahoo mail web page.The strange thing is few days it worked. After that it says mail send but the mail is not actualy send. I have configured my outlook express also for the yahoo accout. Here also i am able to receive .But sending it says send but the message is not received by the receipents.

import java.util.Properties;

import javax.mail.Address;

import javax.mail.Message;

import javax.mail.Session;

import javax.mail.Transport;

import javax.mail.internet.InternetAddress;

import javax.mail.internet.MimeMessage;

public class SendEmail

{

public static void main(String[] args) throws Exception

{

if(args.length != 6)

{

System.out.println("Usage: SendMail host user password fromAddress toAddress subject");

return;

}

String host = args[0];

String user = args[1];

String password = args[2];

String fromAddress = args[3];

String toAddress = args[4];

String subject = args[5];

System.out.println("Sending Message");

System.out.println("Host: " + host);

System.out.println("User: " + user);

System.out.println("Password: " + password);

System.out.println("fromAddress: " + fromAddress);

System.out.println("toAddress: " + toAddress);

System.out.println("subject: " + subject);

Properties props = System.getProperties();

props.put("mail.smtp.host", host);

p.put("mail.smtp.port", "587"));

props.put("mail.smtp.auth", "true");

Session session = Session.getDefaultInstance(props, null);

MimeMessage message = new MimeMessage(session);

message.setFrom(new InternetAddress(fromAddress));

message.addRecipient(Message.RecipientType.TO, new InternetAddress(toAddress));

message.setSubject(subject);

message.setText("Test Message");

Transport transport = session.getTransport("smtp");

transport.connect(host, user, password);

message.saveChanges();

transport.sendMessage(message, message.getAllRecipients());

transport.close();

System.out.println("Sent !!!!");

}

}

This is the code i am using. Only change is i have put the smtp.port since the yahoo smtp is on 587. I was wondering how one day it worked for me

jossy v jose

jossyvjose at 2007-7-1 3:33:15 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...