javamail

DATA command hangs

Hello, what can i do, if a Mailserver accepts a connection but does not return any data? The default javax.mail implementation just hangs indefinitley. Event setting the smtp.timeout does not help - it still hangs. I even tried to set a custom SocketFactory to set the sotimeouts and solinger directly, but it still hangs. Somehow the soc...

getting base64 content string of an image from a mimepart in Java

Hello, I am trying to get the base64 content of a MimePart in a MimeMultiPart, but I'm struggling with the Javamail package. I simply want the base64 encoded String of a certain inline image, there doesn't seem to be an easy way to do this though. I wrote a method that will take the mime content (as a string) and an image name as a para...

How to build an email alert system

We are building an email alert system which needs to send customized emails in real time based on certain criteria (think Google alerts). The application sends emails to multiple users from a web application currently implemented using a JMS bean that uses JavaMail to make the email sending asynchronous. We were wondering if there are o...

javamail smtp issue

I am using spring to send mail and for some reason its stripping the from email address. I ma sending the complete address form the sender to the mails server. I can see the mail (.eml) file in the Dropbox under c:/inetpub/mail but its not sent Following is the log of from the mail server 10.105.21.299, taq02, 5/4/2010, 14:50:32, SMTPS...

Java Mail timeout & connectiontimeout handling

Hi, I'm using JavaMail to send email requests to an SMTP server. I would like to set both "mail.smtp.connectiontimeout" and "mail.smtp.timeout" properties within my code. Programmatically, I want to catch both when timeout and/or connectiontimeout operations are reached in Java and handle things accordingly. Handling in the sense, I n...

Installing JavaMail using Eclipse JavaSE 1.6

Would someone please be able to explain to me how to properly install JavaMail and have it to execute in Eclipse please. I have been trying for the past few hours and I am completely lost as to why this is. This is from trying to execute their demo projects msgsend.java and msgshow.java. I either find an error message stating inval...

Using James Server in Eclipse With JavaMail

Would anyone be able to tell me how I can go about using James server as my server with Java in Eclipse? I'm trying to test the two classes posted below but i get the following error: Exception in thread "main" javax.mail.AuthenticationFailedException: Authentication failed. public class JamesConfigTest { public static void main(String...

JavaMail Read Messages

Ok, so two questions. I'm able to access and read my new email inbox using javamail but: If i try to read the messages already found by javamail, javamail seems not to be able to read them again. Javamail cant read messages with numbers in the subject. How can I make it so that both of these are possible? Thank you UPDATE: Fixed q...

regular expression to remove original message from reply mail using in java ?

In my forum, users can reply through email. I am handling mails from their reply. When they are replying the original message getting appended. I want to get only the reply message not the original message. I have to write regular expression for gmail & hotmail. I written regex for gmail as follows : \n.*wrote:(?s).*--End of Post-- ...

How to write java program to read new emails from any emailid

Hi I want to write a java program where I will provide my email id and password. and I want to read all new unread messages that arrived to that email id. I donot know how to write program for that. The below program works fine for gmail. but it does not work for yahoomail because for yahoo pop3 is not configured. I want a generic code ...

How to identify the email which i got from black-berry / iphone / ipad ?

I want to know the mobile phone name(blackberry/iPhone/ipad) from which mobile I got email. How to identify the mobile name ? Are there any headers to identify the mobile name ? ...

Trying to send email in Java using gmail always results in username and password not accepted.

When I call the send method (after setting studentAddress), I get this: javax.mail.AuthenticationFailedException: 535-5.7.1 Username and Password not accepted. Learn more at 535 5.7.1 http://mail.google.com/support/bin/answer.py?answer=14257 y15sm906936wfd.10 I'm pretty sure the code is correct, and 100% positive that the username and ...

How do I send an email with embedded images AND regular attachments in JavaMail?

Hi, I'd like to know how to build an SMTP multipart message in the correct order so that it will render correctly on the iPhone mail client (rendering correctly in GMail). I'm using Javamail to build up an email containing the following parts: A body part with content type "text/html; UTF-8" An embedded image attachment. A file attac...

Javamail: Get mail server information

I trying to find out how to get the mail server information on the server I connect to with Javamail. I know in the debug statements when you connect you will get something like "S: +OK [MAIL_SERVER_NAME] ready.". Is there an easier way to get this information (and hopefully more information) than just parsing the debug output? ...

how to convert String to message in java mail api?

how to convert String to message in java mail api? ...

How do I configure a mail server for use with JavaMail?

I'm trying to work with the below code: import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; // important import javax.mail.event.*; // important import java.net.*; import java.util.*; public class servletmail extends HttpServlet { public void doPost(HttpSe...

Java mail attachment not working on Tomcat

Hello guys, I have an application which e-mails confirmations. The email part utilises Commons Mail API. The simple code which does the send mail is as shown below; import org.apache.commons.mail.*; ... // Create the attachment EmailAttachment attachment = new EmailAttachment(); attachment.setURL(new URL("http://cashew.org/doc.pdf")); ...

What does props.put("mail.smtp.host", host) in JavaMail do?

Can anybody explain me what this line means in JavaMail API? props.put("mail.smtp.host", host); It is used to setup a mail server, but I don't understand it. ...

help with javamail api

import javax.servlet.*; import javax.servlet.http.*; import java.io.*; import javax.mail.*; import javax.mail.internet.*; import javax.mail.event.*; import java.net.*; import java.util.*; public class servletmail extends HttpServlet { public void doPost(HttpServletRequest request,HttpServletResponse response)throws ServletException,IOExc...

javamail error :must issue starttls command first

im trying to send a mail using javamail api using the below code:when i compiled the class file im getting the below error which says 'must issue starttls command first' i have mentioned the error below. and also getProvider() function error i think so...i dont know what the errors mean. import javax.servlet.*; import javax.servlet.http...