NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.
All the Perl that's Practical to Extract and Report
Stories, comments, journals, and other submissions on use Perl; are Copyright 1998-2006, their respective owners.
Don't trust Javamail.... (Score:1)
Besides the fact that I use Mime::Lite for the majority of my tasks where I need to send email from an application, I also don't trust Javamail to get the job done.
More than one occasion I have run into issues where Javamail never emitted any sort of error but the email did not get sent.
My solution: have Java hand email requests off to Perl through a database.
create table email_request (
email_request_id serial not null primary key,
subject text not null,
message text not null,
from text not null,
reply_to text
);
create table email_recipients (
email_recipient_id serial not null primary key,
recipient text not null,
email_request_id integer not null
references
email_request(email_request_id)
);
A cron job then processes the requests and then removes them when done. I use transactions to make sure that a cron execution doesn't process a request before Java has a chance to finish making the request.
Peter L. Berghold -- Unix Professional
Reply to This