geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Arun Venugopal <Arun.Venugo...@cognizant.com>
Subject Re: javamail issue
Date Thu, 15 Dec 2005 08:11:59 GMT

Hi Aaaron,

Does that mean that I cannot use the plain javamail implementation in
Geronimo and that I have to use the APIs provided by Geronimo 

Thanks and regards
Arun

On Wed, 2005-12-14 at 14:27 -0500, Aaron Mulder wrote:

> If you're planning to use Geronimo's JavaMail features, you should be
> on a very current version (built from source or the 1.0 release
> candidate).  Then you want to add a line like this to your Geronimo
> deployment plan:
> 
> <import>geronimo/javamail/1.0/car</import>
> 
> That way, you should be sure to get our JavaMail code on the classpath
> of your application.  The JavaMail configuration is not started by
> default, though it should be started when you deploy an application
> that depends on it.  If you want to start it by hand, you can always
> use
> 
> java -jar bin/deployer.jar start geronimo/javamail/1.0/car
> 
> Thanks,
>     Aaron
> 
> On 12/14/05, Arun Venugopal <Arun.Venugopal@cognizant.com> wrote:
> >            Hi,
> >
> >  I have this piece of code that uses javamail .  This code works fine when i try
it as a standalone java application (ie when i put it in java file, compile it and run it).
But when i put this code in an war (and call it from a servlet) and then deploy the war in
geronimo, it does not work. I am pretty sure that this code is being called as any System.out.println
that i give in between the code gets displayed in the console. Also i tried out the same code
in JBoss and it seems to work there also.
> >
> >  I have seen many discussions in the dev list regarding the JavaMail implementation.
But i think all that is with regards to creating a new API for geronimo in the lines of the
mail API's present in JBoss. And that since i am using plain java mail it should work irrespective
of the application server.
> >
> >  Can any one give me any pointers on why i am having this issue in geronimo and
if i can solve it ...
> >
> >
> >  -----------------------------------------------------------------------------------------------------------------------
> >
> >          //substitute your mail address here
> >          String from = "a@b.c";
> >          String to = "a@b.c";
> >          //substitute the host name or ip of your smtp server here
> >          String host = "1.2.3.4";
> >          Properties props = new Properties();
> >          props.put("mail.smtp.host", host);
> >          props.put("mail.debug", "true");
> >          Session session = Session.getInstance(props);
> >          try {
> >
> >              Message msg = new MimeMessage(session);
> >              msg.setFrom(new InternetAddress(from));
> >              InternetAddress[] address = {new InternetAddress(to)};
> >              msg.setRecipients(Message.RecipientType.TO, address);
> >              msg.setSubject("Test E-Mail through Java");
> >              msg.setContent(msg, "text/plain");
> >              msg.setSentDate(new Date());
> >              msg.setText("Test Message");
> >              Transport.send(msg);
> >
> >  -------------------------------------------------------------------------------------------------------------------------
> >
> >
> >
> >  Thanks in advance
> >
> >  Regards
> >  Arun
> >
> >
> > This e-mail and any files transmitted with it are for the sole use of the intended
recipient(s) and may contain confidential and privileged information.
> >  If you are not the intended recipient, please contact the sender by reply e-mail
and destroy all copies of the original message.
> >  Any unauthorized review, use, disclosure, dissemination, forwarding, printing or
copying of this email or any action taken in reliance on this e-mail is strictly
> >  prohibited and may be unlawful.
> >
> >    Visit us at http://www.cognizant.com
> >


This e-mail and any files transmitted with it are for the sole use of the intended recipient(s)
and may contain confidential and privileged information.
If you are not the intended recipient, please contact the sender by reply e-mail and destroy
all copies of the original message. 
Any unauthorized review, use, disclosure, dissemination, forwarding, printing or copying of
this email or any action taken in reliance on this e-mail is strictly 
prohibited and may be unlawful.

  Visit us at http://www.cognizant.com
Mime
View raw message