Mail problem urgent

A

Amit Kumar

I need help..
Need to send mail throgh Java file...i am using Mail.jar and self-
created Mailer object that can send text messages.
But I need to send mail in html format. Please help me in doing
that....I've no restriction to use any other jar file.

Need Urgently...
 
?

=?ISO-8859-1?Q?Arne_Vajh=F8j?=

Amit said:
I need help..
Need to send mail throgh Java file...i am using Mail.jar and self-
created Mailer object that can send text messages.
But I need to send mail in html format. Please help me in doing
that....I've no restriction to use any other jar file.

mimebodypart.setContent(content, "text/html; charset=ISO-8859-1");

Arne
 
R

Roedy Green

Need to send mail throgh Java file...i am using Mail.jar and self-
created Mailer object that can send text messages.
But I need to send mail in html format. Please help me in doing
that....I've no restriction to use any other jar file.

Just look at the JavaMail tutorial. You can also see sample code as
part of http://mindprod.com/products.html#BULK
 
C

chandu

Just look at the JavaMail tutorial. You can also see sample code as
part ofhttp://mindprod.com/products.html#BULK

See the JavaMail api as suggested earlier,the classes you will be
using are Message, Session etc...
The you have to do the following.
1. Create a Session instance
2. Then get a Message instance on the created session Message message
= new MimeMessage(session);
3. Then set recipient,subject etc like message.setSubject(subject);
4. Then set the content type of message as message.setContent(message
to be sent, "text/html");
5. At last call send() of Transport to finally sent this message
Transport.send(message);

If you want to arrange the text of 'message to be sent' then use HTML
tags which you are creating the text.

chandan
 
C

ck

mimebodypart.setContent(content, "text/html; charset=ISO-8859-1");

Arne

And the JavaMail api contains a pdf file which gives a brief about how
to make use of API.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top