You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Alex Wallace <to...@rwsoft-online.com> on 2002/09/23 19:22:18 UTC

Tomcat Email - JavaMail Advice.

I need to make a web app that will notify and monitor activity to users by
email, and potentially thousands of users (therefor emails). I want to ask for
advice as to how to handle this.

Should the web app generate all the emails? May be use another machine as a mail
server (linux with exim?), but have the web app generate them?

Have the web app just insert all emails to be sent in a database table and have
a separate application monitor the table or have trigers in the db server
(postgresql) that will launc the app (java?) that will send the emails?

As far as JavaMail, i did a small test with the code in the example in tomcat
(EmailServlet), I tried to send 1000 emails to a server of mine, using localhost
as the smtp server, and around the 70th email, the app complained about a nested
error, the localhost could not be contacted, connection refused, etc.  My code
is very simplistic, and I only did a for loop to try to send the same email a
thousand times to the same host. Evidently this doesn't work. I'm very new to
this, so could someone give me some advice on how to send large amounts of
email? Currently using linux (debian woody) with exim.

Advise in all aspects of this email is greatly appreciated.

Thank you in advance!



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: Tomcat Email - JavaMail Advice.

Posted by Raj Saini <ra...@emerging-trade.com>.
Hi,

The one solution I suggest is to using a messaging product like JbossMQ or
OpenJMS. You you web application collect the data of the mail and wrap it
into an object and send it to the JMS server. Your web application will be
free to do another work now.

You can have a Message Drive Bean (MDB) or async client to the JMS. As and
when the mail message will arive the MDB or the Async client will
automatically pick this up and send it to any server.

You can load balance your web application just to collect the the mail
information and not to sit in a tight loop for processing the mails.

I am using this for a Trading system where the order execution messages are
mailed to user. The advantage here is if you have a lot of mail to send they
will be put in a queue and you application will always be available for
doing the core work.

In my opinion, this should be the best solution for your problem

Raj Saini

----- Original Message -----
From: "Alex Wallace" <to...@rwsoft-online.com>
To: "Tomcat Users List" <to...@jakarta.apache.org>
Sent: Monday, September 23, 2002 6:22 PM
Subject: Tomcat Email - JavaMail Advice.


> I need to make a web app that will notify and monitor activity to users by
> email, and potentially thousands of users (therefor emails). I want to ask
for
> advice as to how to handle this.
>
> Should the web app generate all the emails? May be use another machine as
a mail
> server (linux with exim?), but have the web app generate them?
>
> Have the web app just insert all emails to be sent in a database table and
have
> a separate application monitor the table or have trigers in the db server
> (postgresql) that will launc the app (java?) that will send the emails?
>
> As far as JavaMail, i did a small test with the code in the example in
tomcat
> (EmailServlet), I tried to send 1000 emails to a server of mine, using
localhost
> as the smtp server, and around the 70th email, the app complained about a
nested
> error, the localhost could not be contacted, connection refused, etc.  My
code
> is very simplistic, and I only did a for loop to try to send the same
email a
> thousand times to the same host. Evidently this doesn't work. I'm very new
to
> this, so could someone give me some advice on how to send large amounts of
> email? Currently using linux (debian woody) with exim.
>
> Advise in all aspects of this email is greatly appreciated.
>
> Thank you in advance!
>
>
>
> --
> To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
> For additional commands, e-mail:
<ma...@jakarta.apache.org>


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


RE: Tomcat Email - JavaMail Advice.

Posted by Mike Jackson <mj...@cdi-hq.com>.
Could be a garbage collection problem.  Try adding a System.gc() call
in the loop, run every 10th or so time you send an email.  That may
or may not fix the problem, or it might just give you the same results.
If it does help then you should probably look at how you're doing the
email, are you recreating objects needlessly...

Regardless, it can't hurt to try.

--mikej
-=-----
mike jackson
mjackson@cdi-hq.com

-----Original Message-----
From: Alex Wallace [mailto:tomcater@rwsoft-online.com]
Sent: Monday, September 23, 2002 10:22 AM
To: Tomcat Users List
Subject: Tomcat Email - JavaMail Advice.


I need to make a web app that will notify and monitor activity to users by
email, and potentially thousands of users (therefor emails). I want to ask
for
advice as to how to handle this.

Should the web app generate all the emails? May be use another machine as a
mail
server (linux with exim?), but have the web app generate them?

Have the web app just insert all emails to be sent in a database table and
have
a separate application monitor the table or have trigers in the db server
(postgresql) that will launc the app (java?) that will send the emails?

As far as JavaMail, i did a small test with the code in the example in
tomcat
(EmailServlet), I tried to send 1000 emails to a server of mine, using
localhost
as the smtp server, and around the 70th email, the app complained about a
nested
error, the localhost could not be contacted, connection refused, etc.  My
code
is very simplistic, and I only did a for loop to try to send the same email
a
thousand times to the same host. Evidently this doesn't work. I'm very new
to
this, so could someone give me some advice on how to send large amounts of
email? Currently using linux (debian woody) with exim.

Advise in all aspects of this email is greatly appreciated.

Thank you in advance!



--
To unsubscribe, e-mail:
<ma...@jakarta.apache.org>
For additional commands, e-mail:
<ma...@jakarta.apache.org>




--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>