javamail

Sending messages to spam folder

I want to know what do I have to do in my mail application to move rest of the messages of marking any email address as spam into spam folder without restarting mail server. Actually I can move the messages into spam folder, but I have do some configuration in my mail server, then have to restart it before making it move to spam folder i...

Apache James as a transparent SMTP proxy?

Hi guys! I'm thinking about building a transparent SMTP proxy on my own to process outgoing mails. I found Apache James already that looks like it is pretty much what I want. Could I use Apache James to build a transparent SMTP proxy to add some headers and modify the content? Or should I go for pure Javamail? ...

Creating mail application for project

Hi, I'm currently creating mail application for my project, and I'm currently trying to figure out, how mail application like gmail, moves all the messages of particular email address, which I clicked as spam into the spam folder at runtime whenever that marked spam address send messages again. What configuration they do? I want to enab...

SMTPTransport as private static for class that implements MessageDrivenBean and MessageListener

If I use SMTPTransport (http://java.sun.com/products/javamail/javadocs/com/sun/mail/smtp/SMTPTransport.html) as private static object for class that implements MessageDrivenBean and MessageListener, will it be thread safe or are there some possible error situations? ...

java.lang.NoClassDefFoundError help

I'm trying to read a mail from Tomcat 6.0. Whenever I put the byte code and source code of the class MailReader in the same folder(and putting the main method), I can compile and run the class and read mail from command prompt, but when I put that class in the folder WEB-INF/classes of tomcat(by removing main method), I'm getting big fat...

failing to retrieve multiple checked value from JSP

I'm trying to retrieve mulitple checked value, which are being showed in JSP dynamically, retrieved from inbox folder of the mail server, just like in yahoo, or gmail. But whenever I select multiple checkboxes(or either one), I'm not able to retrieve their values, like subject and username. What should I have to do in JSP to retrieve tho...

java.lang.NoClassDefFoundError: javax/mail/Authenticator, whats wrong?

Send to Email.java package helper; //Mail.java - smtp sending starttls (ssl) authentication enabled //1.Open a new Java class in netbeans (default package of the project) and name it as "Mail.java" //2.Copy paste the entire code below and save it. //3.Right click on the file name in the left side panel and click "compile" then click "R...

Algorithm to move messages from inbox to junk folder

Hi, I wonder how sites like yahoomail or gmail move the messages, which we click as spam into the spam folder. As far as I concerned Bayesian analysis algorithm checks the messages, if it is spam based on content, or some other probability. But what algorithm do these sites(yahoomail or gmail) use to migrate the message from one folder ...

timeout with JMAPI???

I am using JM-API for my mailing application. When, i am sending or receiving a single mail, works perfectly. But, if i try to do manipulation on more then single mail (say, copy 1st 3 mails of INBOX to TRASH), timeout occurs. While googling to cure this, i got, 1 [see, 2nd last post by vivek mathur] , 2 and 3. But nothing seems to ...

Mail Server download help

Hi, Is there any mail server, which can use with javamail, simple in operating, having POP3, IMAP, and SMTP support? I know James, but it doesn't provide support for IMAP. Is anybody know? ...

Help in deleting the messages from inbox folder

Hi, I'm trying to delete the messages which is selected by user by clicking the checkbox and then clicking the delete button, but I don't understand why my code is not performing the desirable result. Here's the code in Javamail: public static boolean deleteMessage(int j) throws Exception { store = session.getStore("pop3"); store.c...

How should a Java program handle an external mail server being down?

I have a constantly-running Java program that needs to send an email whenever it encounters a problem. However it is possible that the mail server it uses could be down at the time it tries to send the email. What is the best way to ensure that the email will be delivered when the mail server comes back up? ...

How to check status of an SMTP server from Java?

In a Java program, what is the best way of determining if an SMTP server is ready to accept and send an email? ...

JavaMail Exchange Authentication

Hello, I'm trying to use Exchange authentication from my app using JavaMail to do this. Could some one give me a guide to do this? After authentication I need to send mails that's the main reason that I'm using JavaMail. All the links that I found talks about problems with this but I think this must be an easy task to do from Java. Than...

How to attach a file to an email using JavaMail

I need to send a PDF file using JavaMail. The PDF is currently a byte[]. How do I get it into the DataSource? byte[] pdffile = .... messageBodyPart = new MimeBodyPart(); DataSource source = ??? messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); multipart.addBodyPart(messageBodyPart); ...

Download attachments using Java Mail

Now that I`ve downloaded all the messages, and store them to Message[] temp; How do I get the list of attachments for each of those messages to List<File> attachments; Note: no thirdparty libs, please, just JavaMail. ...

Message charset

How do I get the charset from javax.mail.Message object? ...

JavaMail BaseEncode64 Error

Hi, I'm currently developing an application which download attachment from gmail account. Right now, I got error whenever downloading zipped attachment. But, not all, some I can retrieve it without error. Here's the Exception message: Exception in thread "main" com.sun.mail.util.DecodingException: BASE64Decoder: Error in encoded stream...

javamail vs sendmail performance during bulk email

Hi all, I'm writing a Java mass emailer application to send out emails to send between 50,000 to 100,000 a day to users. The current plan is to delegate the sending to delegate to sendmail (on the local unix server). From our testing sendmail is sending a maximum of 5 emails per second. Would JavaMail be a faster option? Does anyo...

How to set the Return-Path to an email address other than Sender address using JavaMail?

How to set the Return-Path to an email address other than Sender address using JavaMail? ...