Retrieving Email attachment from Outlook - java

I have a requirement, I am getting more bounced emails when i send some email newsletters to my clients and I am sending the email fron Outlook. Bounced email is coming from "Mail Delivery Subsystem" and it has some attachments. In that attachments, it is having my original mail. I want to extract that original email through java. I would like to know any feasible solution for this
Any help in this regard is much appreciated.

For Exchange Server 2007+, you could use Microsoft Java EWS API or just talk directly to EWS. See related SO post.
You would have to use .NET to integrate directly with Outlook via VSTO.

Related

Email Automation from Outlook Express using JACOB.jar with Java

I have to automate emails from Outlook Express Client using Java. Below are the requirements:
Format the RichText Email using predefined template(Provided in Excel)
Send the email to dedicated Receiver Email Id
Send the reminder email by keeping the history of previous email
I was able to achieve all the mentioned requirements for Lotus Mail Email Client by using Notes.jar.
As I can not use JavaMail to directly send email to Email Server and Read due to Organization's Policy. So I have to go with automation from Email Client only.
I have heard about JACOB.jar. Can anyone please share if above all mentioned requirements be achieved with JACOB.jar? It would be really a great help.

How to find if mail delivery succeeded or not using javax.mail api if recipient mail id doesnot exist

I am working on sending a mail to a recipient in jsp and servlets,
I am using javax.mail api for this.
I need to send an auto generated email which cant be replied back.
Can i achieve this using javax.mail api? i am setting 'from' as some dummy mail address for now so the recipient cant reply back right? Is there any other way or doing this???
secondly, in case if the recipient mail id doesnt exist, i am not getting any MessagingException. How to check whether message delivered or not? how can i confirm that?
Need your help! Thanks in advance!!

How to make reply of an email becomes a HttpRequestServlet to a web application?

I got a requirement which I don't know how to get started.
Requirement:
The application will send emails to clients (using org.springframework.mail.javamail.JavaMailSender) with same "from email address" as support#mydomain.com. Also the email content will have some hidden information such as client_id. If the client reply back to that email, I need to get that as an HttpServletRequest to a Servlet so that I can process it.
EDIT:
This web application does not have google app engine setup, but my requirement is matching similar to this link.
When someone replies to the mail you sent him that mail will go to the POP3 server configured for your domain. From this SMTP server you can read this mail using the Java Mail API. You can have a Spring timer task to keep polling this mailbox after every few seconds.
I would look at the below resources to see how to read mail from the POP3 server -
Using JavaMail API -
http://metoojava.wordpress.com/2010/03/21/java-code-to-receive-mail-using-javamailapi
Using Spring -
http://blog.solidcraft.eu/2011/04/read-emails-from-imap-with-spring.html
Better and popular solution is to have a link in your email and asking user to click it and asking specifically not to reply to this email (from address can be noreply#domain.com)
For getting a servlet call in an email reply, you need to use
http://javamail.kenai.com/nonav/javadocs/com/sun/mail/pop3/package-summary.html
Keep polling for new emails in your reply address(for eg support#domain.com) using POP, and when new email comes trigger a httprequest(HttpClient? ).
On a related note you can add user_id and similar stuff using a + in reply email address
For eg support#domain.com and support+uid_21_catid_32#domain.com will deliver to same address. Everything after + is ignored. But you will get this info in reply email event as to address and decide on who is the user.This could be a security concern for sure if not properly implemented.

Is there any java library to access client's emails?

I am looking for a java library to access(show) client's emails in a web app.
For instance user comes to the site, enters credentials, smtp and all this stuff (like when doing Import in Thunderbird or Outlook) and our website can show him his emails in the browser...
Are you aware of such library? Is this possible?
IIRC, JavaMail is mostly for sending emails but what I need is to access and list client's emails.
there many opensource client mail tools which can be coustomised as you need, please check below below
Client Emails Access
Update :
check this Chilkat
Here is a sample code how-to-create-an-e-mail-client-in-java
Yes Javamail can do exactly what you are asking. Javamail isn't for just sending emails. You can access a user's mailbox. Sending emails is over the SMTP protocol. Javamail supports SMTP, POP3, and IMAP. You're interested in POP3 or IMAP.
http://www.oracle.com/technetwork/java/javamail/index.html

How to send an email to a java program

I'd like to write a program, probably a servlet or something to run on the a google app engine that I can send an email to. So not a program to send email, but one that can receieve it and parse it.
My question is, what code or API are out there that can receive an email?
Basically on your google app engine you can use an inbound mail service.
Please see this documentation for more information.
http://code.google.com/appengine/docs/java/mail/overview.html#Receiving_Mail_in_Java
You cant send an email to a program, you send an email to a server, so what you are looking for is a way to access an email server via your program. Unfortunately there is no single solution here, you need to configure your program for every different email account/server you want to access. (If you have ever set up an account in outlook or something like it you will get the idea)
For example here is a link to the gmail api, you could use this to access gmail accounts
http://code.google.com/apis/gmail/
You need to have a mailbox to send message there and you could read messages with the code like this: http://www.java2s.com/Code/Java/Network-Protocol/GetEmailMessageExample.htm
This can be done with a built in Java library.
javax.mail
Check out this link. It should be able to help you get started.
This won't work for every mail server, but depending on your setup it might help.
To send an email to a Java program, that program must be running. Generally that means a server style (aka service) receiver is favored.
For the email to be received, the Java service must understand an email protocol. There are a number of protocols, but SMTP is the standard for receiving email. Once you have a service that understands SMTP protocol for receiving email, you have written a mail server.
Note that most people don't care to write a mail server, as a mail client needs to connect to the server and pull the email to make it readable. Keep this in mind when designing the solution to your problem.

Categories

Resources