Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Email body  RSS feed

 
upanshu vaid
Ranch Hand
Posts: 83
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
The requirements that I want to implement in Java
1-Client sends mail using outlook to IMAP Email server .
2-there is a utility which is written using core Java and Java mail api.
3-I have to read the emails that are on IMAP server.
4- the email body which can have normal text, image,table, html etc.
5- problem I am facing is that I am not able to convert the email body to pdf or word doc.
Kindly help as I am not found the right solution for long time.
Thanks
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
upanshu vaid wrote:Hi,
The requirements that I want to implement in Java
1-Client sends mail using outlook to IMAP Email server .


No they don't.

IMAP is a message retrieval protocol. To send a message, you need an SMTP server. As it happens, Microsoft Exchange offers both functions in one application, but they are entirely separate. On my Linux machines, Sendmail or Postfix act as the SMTP MTA server. Dovecot is the program that provides my POP/IMAP(s) services. They're from different developers and work on different TCP/IP ports.

Although you can do brute-force mail functions - the original SMTP and IMAP services were designed using text-based protocols - the easier way is to use JavaMail.

The full details are more than we can go into here, but basically, you create a mail, set its recipient(s), subject, body, attachments and so forth, then send it off to the mail server. You may have to present credentials (login) to the SMTP server.

On the receiving side, you log into the IMAP server, identify yourself, then you can browse the IMAP folder structure and retrieve selected messages. The same message object components apply as you use when creating and sending email.
 
upanshu vaid
Ranch Hand
Posts: 83
Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the reply
Please help me to resolve my query
Hi,
The requirements that I want to implement in Java
1-I am reading email from IMAP Email server .
2-there is a utility which is written using core Java and Java mail api.
3-I have to read the emails that are on IMAP server.
4- the email body which can have normal text, image,table, html etc.
5- problem I am facing is that I am not able to convert the email body to pdf or word doc.
Kindly help as I am not found the right solution for long time.

 
Rob Spoor
Sheriff
Posts: 20904
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let me get this straight.

You can already connect to the IMAP server for reading emails.
You can already retrieve messages.
All you need to do is convert them to PDF or Word document.

Is this correct? If so, you may want to check out OpenOffice.org. You can call it to do the conversion for you. You'll have to check out its documentation for the specifics. As for PDF, I know have used iText in combination with YAHP (http://www.allcolor.org/YaHPConverter/) in the past to convert (tidy) HTML to PDF.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!