javamail

Email Thread Messages using JavaMail API

*爱你&永不变心* 提交于 2020-01-15 14:17:13
问题 How to identify that particular message is email thread and retrieving messages in that thread using JavaMail API? for email A replies to B B replies to A A emails to B (Original Message) How to fetch information about this thread? Thank you 回答1: RFC 5256 describes an IMAP extension to support threading. Not a lot of servers support it, and JavaMail doesn't support it. If you need to implement the threading algorithm yourself in your application, the RFC includes some references that might be

JavaMail, IMAP, performance with large number of folders

杀马特。学长 韩版系。学妹 提交于 2020-01-14 15:04:08
问题 We are developing a java based mail client for IMAP accounts and use latest java mail api (1.5.6). Our customers have mail accounts with more than 400 folders. Users perform check mails on folders and iterating on each folder and getting new messages for example, folder.getMessagesByUid(lastStoredUID, UIDFolder.LastUID) or getting count of unread messages takes too much time beacuse huge number of folders. (We have to iterate on 400 folders) To increase the performance we used paralel working

Connect to gmail (using imap and javamail) with encrypted password

被刻印的时光 ゝ 提交于 2020-01-14 13:52:05
问题 I'm trying to connect to gmail using a simple java program (like this one). But my question is: Is there a way to do this with encrypted password and not the real password, for security reasons of course!! something like how we do in java-Oracle db ? 回答1: By default, the only authentication mechanism for IMAP is the LOGIN command, which takes an unencrypted username and password. You can add an encryption layer on top of it, either by connecting via IMAPs or starting a TLS layer via the

Send calendar invite per email with java

◇◆丶佛笑我妖孽 提交于 2020-01-14 12:35:56
问题 I'm trying to send calendar invites per email with java. The recipient gets the email but instead of being shown an invitation to accept or decline, the event is automatically added to his calendar. I'm building the event/invite with ical4j.jar private Calendar getInvite(Session session) { Calendar calendar = new Calendar(); calendar.getProperties().add(Version.VERSION_2_0); calendar.getProperties().add(Method.REQUEST); VEvent event = new VEvent( new DateTime(sesion.getStartDate()), new

Send calendar invite per email with java

风格不统一 提交于 2020-01-14 12:32:19
问题 I'm trying to send calendar invites per email with java. The recipient gets the email but instead of being shown an invitation to accept or decline, the event is automatically added to his calendar. I'm building the event/invite with ical4j.jar private Calendar getInvite(Session session) { Calendar calendar = new Calendar(); calendar.getProperties().add(Version.VERSION_2_0); calendar.getProperties().add(Method.REQUEST); VEvent event = new VEvent( new DateTime(sesion.getStartDate()), new

Mail Server with javax.mail and CentOS

走远了吗. 提交于 2020-01-14 09:19:33
问题 I have a Java Program that was installed on an old Ubuntu machine and sent mail using javax.mail. However, that machine went down and I am now running the same Java app in a new CentOS machine. However, I get an error "MessagingException: 501 Syntax: HELO hostname" when trying to send an email using mail.smtp.host = 127.0.0.1. My guess is that the mailserver is not yet activated in this CentOS. How would I go about configuring a mail server that javax.mail can use? Thank you 回答1: Your machine

Sending mime message containing any of these attachment,htmlbody ,inline image or all of them?

岁酱吖の 提交于 2020-01-14 04:03:09
问题 As of know my email application was supporting only plain text with attachments. I was handling it in a simple way if attachment list is null, simply send the mime message and if attchment list is not null, i was creating body part for each attachment and one for body. Adding them in multipart which is set in to mime message. But now need to support the html part and inline images(where images will be sent as attachment and html body will be referreing).I know the basics of mime i.e how to

(Unknown Sender) when sending email with pdf attachment created in iText from java application

梦想的初衷 提交于 2020-01-14 03:49:06
问题 I have a link on a webpage that sends emails out from localhost SMTP with pdf attachments created from iText that I made following How to create an in-memory PDF report and send as an email attachment using iText and Java and it is working, however when I get the emails I can't see the sender name/address. It shows as being from "(unknown sender)" in my gmail inbox and if I hit reply the 'to' box is completely blank. In hotmail is shows as being from "(Unknown)" but when i open it, the sender

What is the type for part.getContent in JavaMail under different os?

久未见 提交于 2020-01-14 00:32:12
问题 I am using JavaMail to receive mails. At first,I develop under Mac OS X.The example I found from Internet seems like this: public void getMailContent(Part part) throws Exception { String contenttype = part.getContentType(); int nameindex = contenttype.indexOf("name"); boolean conname = false; if (nameindex != -1) conname = true; System.out.println("CONTENTTYPE: " + contenttype); if (part.isMimeType("text/plain") && !conname) { bodytext.append((String) part.getContent()); } else if (part

Why JavaMail connection timeout is too long

孤街浪徒 提交于 2020-01-11 20:58:31
问题 In my application I connect to server to authenticate users. This is code: try { Properties prop = new Properties(); prop.put("mail.smtp.starttls.enable","true"); prop.put("mail.smtp.auth", "true"); prop.put("mail.smtp.connectiontimeout", 1000); Session session = Session.getInstance(prop, null); Transport transport = session.getTransport("smtp"); transport.connect("mion.elka.pw.edu.pl", 587, registerLog, registerPass); transport.close(); return true; } catch (NoSuchProviderException ex) {