Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

Mail problem urgent

Thread view: 
Amit Kumar - 13 Mar 2007 10:52 GMT
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...
Arne Vajhøj - 13 Mar 2007 11:21 GMT
> 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
ck - 14 Mar 2007 08:01 GMT
> > I need help..
> > Need to send mail throgh Java file...i am using Mail.jar and self-
[quoted text clipped - 5 lines]
>
> Arne

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

--
Ck
http://www.gfour.net
Roedy Green - 13 Mar 2007 19:34 GMT
>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
Signature

Canadian Mind Products, Roedy Green, http://mindprod.com
Priorities: Prevent global climate destabilisation. End both wars. Prepare for oil shortages.

chandu - 14 Mar 2007 06:51 GMT
On Mar 13, 11:34 pm, Roedy Green <see_webs...@mindprod.com.invalid>
wrote:

> >Need to send mail throgh Java file...i am using Mail.jar and self-
> >created Mailer object that can send text messages.
[quoted text clipped - 6 lines]
> Canadian Mind Products, Roedy Green,http://mindprod.com
> Priorities: Prevent global climate destabilisation. End both wars. Prepare for oil shortages.

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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.