Subject Re: [firebird-support] Re: Emailing from Firebird 1.5 (Linux) in a trigger?
Author Alexandre Benson Smith
Alan McDonald wrote:

>I just think that the sendmail process is stepping out too far from the
>inline process of the database server. For the same reason you don't use
>UDFs to access another database or write to an external file (not including
>debugging process in dev process).
>It's a better design to have a a trigger store a record of "sendmail" and
>have an external application poll the db and query these records. It then
>sends email outside any process of the db server. I don't use events - I'm
>afraid they have always had something wrong with them and there are other
>more reliable ways to do things with less network traffic etc.
>
>
Hi Alan,

I don't know if just starting an light dll to send an e-mail will be a
heavy process (I was thinking in local mail, or a local relay mail
server, a remote server could be more problematic, mainly if the link
could be down).

If it will be using in a "select" I will agree 100% with you, but just
on some inserts, I think this could not be so problematic.

select
Invoice.Number, Invoice.CustomerID,
Mail_UDF(Customer.Email, 'I select your invoice !', Customer.Name ||
cast(Invoice.Total as varchar(20)))
from
Invoice join
Customer on (Customer.CustomerID = Invoice.CustomerID)

will be really a stupid decision.... ;-)

But I think the "event" approach will be better, or even another
application that keeps pooling the server for new mails to be delivered
as you suggested.

>Alan
>
>
>PS - but if you want to, you can do it. There's nothing stopping you.
>
>
off course not... I just want to see your point...

see you !

--

Alexandre Benson Smith
Development
THOR Software e Comercial Ltda.
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br