javamail

How to download only new emails from imap?

感情迁移 提交于 2019-12-22 04:52:08
问题 I have an application that is used to archive emails using imap. Also in this application are many imap accounts that need to be archived. In this moment from time to time the application connects to imap accounts and download only new emails. My issue is that every time when it connects to an imap account it verifies all emails from all folders and downloads only emails that aren't downloaded yet (I store Message-ID for all emails and download only emails that have an Message-ID that is not

javax.mail.AuthenticationFailedException: 535 5.0.0 Authentication Failed

ぃ、小莉子 提交于 2019-12-22 04:25:16
问题 I don't understand why i am getting this exception. This is the code that attempts to send email message. public void sendAsHotmail() { final String username = jTextField14.getText(); final String password = jPasswordField4.getText(); String subject = jTextField16.getText(); String Cc = jTextField17.getText(); String Bcc = jTextField18.getText(); String recipient = jTextArea5.getText(); Properties props = new Properties(); props.put( "mail.smtp.host" , "smtp.live.com"); props.put( "mail.smtp

TLS issue when sending to gmail through JavaMail

独自空忆成欢 提交于 2019-12-22 04:14:14
问题 Turns out that JavaMail is a bit more frustrating than I thought it would be. I've looked at several examples online on how to send a simple SMTP email through Gmail's servers (but not through SSL). After trying several different examples of code, I keep concluding to the same example exception when I call transport.connect() . I keep getting this stack trace: Exception in thread "main" com.sun.mail.smtp.SMTPSendFailedException: 530 5.7.0 Must issue a STARTTLS command first. l10sm302158wfk.21

Unable to Send Mail - javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection? [duplicate]

若如初见. 提交于 2019-12-22 04:12:25
问题 This question already has answers here : Unrecognized SSL message, plaintext connection? Exception (18 answers) Closed 3 years ago . We are sending Mail using Spring JavaMailSenderImpl . Following is the configuration <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="host" value="${host}"/> <property name="port" value="${port}"/> <property name="username" value="${mail.username}"/> <property name="password" value="${mail.password}"/> <property

Mailing with IMAP: How to detect that a message has been moved from one folder to another?

泄露秘密 提交于 2019-12-21 21:46:30
问题 Using JavaMail API and IMAP, i want to learn that a message has been moved from folder a to b. how can i do that without adding listeners? i mean i want to discover the changes of messages when i login to the account and open the folder. The problem is if you have 3 messages in folder a with ids 1 2 and 3 and you move the message with id 3 to the folder B, the id of the message changes and we have a message with id 1 in folder B. My goal is synchronizing the message structure in mail server

Why JMS to send mail by Java Mail

一笑奈何 提交于 2019-12-21 20:09:02
问题 Scenario 1 : Setup a JMS Queue in your server Java code to send Messages to Producer Create a JMS Producer, which when invoked, should receive the email data (subject, body, to , cc etc) and post it to the Queue setup in step 1 Create a JMS Consumer, which subscribes to the Queue created in Step 1, and its onMessage should call the JavaMail API to send the email. Scenario 2 : Directly call the JavaMail API to send the email. I know about how to use and what JMS and Java Mail are doing.Thing

Java mail client to MS Exchange server

断了今生、忘了曾经 提交于 2019-12-21 19:58:17
问题 Our MS exchange server doesn't use Imap or pop3 protocols, I am trying to write a client in Java to connect to the exchange server, I guess I wont be able to do this with Java Mail API (if I am not wrong). I tried telnetting the exchange server address with ports 110 and 143 and 25 but with no luck. Can any one suggest if there is an existing API to deal with this scenario, any suggestions are appreciated. 回答1: Got exJello off of Oracle's site. Probably a good place to start. 回答2: Exchange

java.net.SocketException: Software caused connection abort: socket write error [duplicate]

喜欢而已 提交于 2019-12-21 17:53:56
问题 This question already has answers here : Official reasons for “Software caused connection abort: socket write error” (14 answers) Closed 6 years ago . I am creating an application to send mail with an attachment. When I attach a small zip file it is working perfectly but when i attach a larger (> 1mb) zip file it is returning the error "java.net.SocketException: Software caused connection abort: socket write error" and my application is hanging. my code to attach the files is: protected void

Faster reading of inbox in Java

喜欢而已 提交于 2019-12-21 13:20:22
问题 I'd like to get a list of everyone who's ever been included on any message in my inbox. Right now I can use the javax mail API to connect via IMAP and download the messages: Folder folder = imapSslStore.getFolder("[Gmail]/All Mail"); folder.open(Folder.READ_ONLY); Message[] messages = folder.getMessages(); for(int i = 0; i < messages.length; i++) { // This causes the message to be lazily loaded and is slow String[] from = messages[i].getFrom(); } The line messages[i].getFrom() is slower than

java.lang.NoClassDefFoundError: javax/mail/MessagingException

夙愿已清 提交于 2019-12-21 12:09:07
问题 I've been working on a program that uses the Javamail API to send emails based on time events and certain conditions. The program runs perfectly in Eclipse (newest version) and the javamail and activator jars are in the build path, as are javamail's dependencies. The problem occurs when I export the project as a jar and try to run it. (The stack trace generated is the same that would be if the javamail jar was missing from the Eclipse build path). The stack trace is as follows: `Exception in