aspose file tools*
The moose likes Other JSE/JEE APIs and the fly likes Java MySQL Mail problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Java MySQL Mail problem" Watch "Java MySQL Mail problem" New topic
Author

Java MySQL Mail problem

Ray Wiltfong
Greenhorn

Joined: Jun 20, 2005
Posts: 2
Howdy?

I am clueless when it comes to Java but planning to change that.

I wrote a mass mailer plugin for a news forum script. It is all written in PHP. It all works perfectly except that PHP has a 30 second time out.

My Question is:
Is there a way to have php activate a java script that can run on it's own beyond the 30 second limit, email the addresses stored in a mysql table and then terminate on it's own when finished?

I would love to hear any ideas on how to solve this problem.
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336


Is there a way to have php activate a java script

Yes there is. You can integrate PHP into a servlet environment via a SAPI module, or use the PECL Java extension.

But before you rush off to look at that, what is it that is timing out? I ask, because PHP itself doesn't inherently stop processing after 30 seconds, so a change in technology could very well be wasted effort. Does your email server drop the connection after 30 seconds?


JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Ray Wiltfong
Greenhorn

Joined: Jun 20, 2005
Posts: 2
Hi Paul,

The default max_execution_time for php is 30 seconds for a windows build which is set by the php.ini

And the default timeout on a windows IIs is 300 seconds. Obviously I can extend those times manually but this only moves the problem but soes not solve it and now I have a portability / install issue.

I am looking for a solution that will work with the standard ISAPI php - Portability is a must.

All the java would have to do is activate, run independant of the php and merge a html email from one table into a list of addresses from another table and send that out on port 25.

Just not sure how php hooks java in that, is the java wrapped in the php and will the java stop executing at 30 seconds too? I would think so unless it was a servlett. Way above my pay grade...

Also my SMTP server is not being used as the php is sending the email directly to someone elses smtp server and no it is not timeing out.

BTW - Thanks for the reply!

[ June 20, 2005: Message edited by: Ray Wiltfong ]
[ June 20, 2005: Message edited by: Ray Wiltfong ]
Paul Sturrock
Bartender

Joined: Apr 14, 2004
Posts: 10336

Ah right - so its the time allowed to process a request which is the problem. Sound like you undoubtabley need some sort of daemon process to handle this mailing functionality. In which case, just write it as a seperate Java application - you might look at Timers for this.
[ June 21, 2005: Message edited by: Paul Sturrock ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java MySQL Mail problem
 
Similar Threads
Possible to call PHP webpage from Applet?
Question about PHP-enabled servers
Java code sitting along with php.. assisting
Any good free Messageboards on the internet?
Javascript carry the variable over to next page