javamail

Camel mail 2.13.0 searchterm: How to configure multiple from addresses?

核能气质少年 提交于 2019-12-24 07:47:12
问题 I only have to consume mails from the mailbox which are from address x OR address y. How can i configure this in a camel uri? I've only found the searchTerm configuration with 1 address(searchTerm.from=x) 回答1: segment your route using Direct Component, it works like method call for example: <route> <from uri="imap://admin@mymailserver_1"/> <to uri="direct:processMail"/> </route> <route> <from uri="imap://admin@mymailserver_2"/> <to uri="direct:processMail"/> </route> <route> <from uri="direct

Javax.mail : Connection timed out only when connected to WiFi

两盒软妹~` 提交于 2019-12-24 06:44:08
问题 I'm creating an app, which sends an Email to my Gmail address automatically when opened (No need to open any other default Email sender app from device(i.e Gmail)). I've followed this link for creating this application. It works perfectly when device is connected to 4G data pack. But when I connect my device to WiFi, Every time it gives connection timed out . The complete error log is: W/System.err: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465; W

Why do i get this exception?

偶尔善良 提交于 2019-12-24 05:21:23
问题 This method gives the number of emails in the inbox.But it gives me this exception : javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed out: connecterror - Session session = Session.getInstance(new Properties()); try { Store store = session.getStore("pop3"); store.connect("pop.gmail.com" , "username" , "password"); Folder fldr = store.getFolder("INBOX"); fldr.open(Folder.READ_WRITE); int count = fldr.getMessageCount(); System.out

Why do i get this exception?

给你一囗甜甜゛ 提交于 2019-12-24 05:21:08
问题 This method gives the number of emails in the inbox.But it gives me this exception : javax.mail.MessagingException: Connect failed; nested exception is: java.net.ConnectException: Connection timed out: connecterror - Session session = Session.getInstance(new Properties()); try { Store store = session.getStore("pop3"); store.connect("pop.gmail.com" , "username" , "password"); Folder fldr = store.getFolder("INBOX"); fldr.open(Folder.READ_WRITE); int count = fldr.getMessageCount(); System.out

How can I fix ClassNotFoundException: com.sun.mail.util.MailLogger?

☆樱花仙子☆ 提交于 2019-12-24 04:14:05
问题 I want to send email, My code is below public static void main(String[] args) { final String username = "emailId@gmail.com"; final String password = "password"; Properties props = new Properties(); props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); Session session = Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication

javax.mail.internet.ParseException: Expected “/”, got files

与世无争的帅哥 提交于 2019-12-24 03:49:10
问题 I am getting an error while trying to send an email with file attachment : javax.mail.internet.ParseException: Expected '/', got files at javax.mail.internet.ContentType.<init>(ContentType.java:102) at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1331) at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1021) at javax.mail.internet.MimeMultipart.updateHeaders(MimeMultipart.java:419) at javax.mail.internet.MimeBodyPart.updateHeaders(MimeBodyPart.java:1354)

How to store mail password on server side?

梦想的初衷 提交于 2019-12-24 01:53:55
问题 I need to send e-mails from my application that is deployed on Weblogic 10.0. I try to put mail session properties on server side. Properties like mail.host or mail.debug work OK. But how do I configure password? Now I have it in spring configuration file: <bean id="mailSender" class="org.springframework.mail.javamail.JavaMailSenderImpl"> <property name="session" ref="mailSession"/> <property name="username" value="myLogin"></property> <property name="password" value="myPassword"></property>

Getting ParseException on Transport.send(message)

时光毁灭记忆、已成空白 提交于 2019-12-24 00:39:41
问题 For some reason I'm getting a javax.mail.internet.ParseException when I call Transport.send() on a MimeMessage. This worked before when it was only a plain text email, but when I changed it to have both text and html it started blowing up. Any ideas what I'm doing wrong? @Resource(mappedName = "java:/Mail") private Session mailer; public void sendMessage(String toEmailAddress, String subject, String content, String text) throws Exception { try { Message message = new MimeMessage(mailer);

Issue processing MailDir format with Java on Windows

空扰寡人 提交于 2019-12-24 00:01:29
问题 This is really two questions, but they are very closely related. I am developing a Java application that will process emails stored in the UNIX style MailDir format. I am using the JavaMail API, and found JavaMailDir that should work as a provider capable of reading the format my email will be in. The issue I am running into is that JavaMailDir seems to always expect your mail folder (the one passed into store.getFolder() ) to begin with a dot. I only have access to a Windows machine for my

JavaMail base64 encoding

你。 提交于 2019-12-23 17:48:01
问题 I have some Java code which sends out an email with code somewhat like the following: MimeBodyPart part = new MimeBodyPart(); part.setContent(htmlString, "text/html; charset=\"UTF-8\""); part.setHeader("MIME-Version", "1.0"); part.setHeader("Content-Type", "text/html; charset=\"UTF-8\""); part.setHeader("Importance", severityVal); mimeMultiPart.addBodyPart(htmlPart); mimeMessage.setContent(mimeMultiPart); ... and so on. How can I encode the "part" MimeBodyPart in base64 for this outgoing