Re: Sending Email

From: Jason Earl <jason(dot)earl(at)simplot(dot)com>
To: denis(at)coralindia(dot)com
Cc: <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Sending Email
Date: 2002-01-17 18:19:31
Message-ID: 871ygodemk.fsf@npa01zz001.simplot.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

denis(at)coralindia(dot)com writes:

> Hi all,
>
> Is there any package / procedure in PostGres to send email (like
> UTL_SMTP in Oracle)
>
> Thanx
>
> Denis

The way to do this in a transaction safe way is to have some sort of
process that runs outside of PostgreSQL. You put the information
necessary to generate your email into a table, and then you call the
process (probably from cron). This makes it much easier to do error
checking. Instead of firing triggers from PostgreSQL and hoping that
the mail actually gets sent. You simply select from your outgoing
mail table, create the necessary emails, and remove the entries in the
table. This allows you to rollback changes to your database on
failure, and guarantees that a problem with your email setup won't
send valuable mail to the bit bucket.

Besides, generating and sending email is probably easier to do from
Python or Perl than any method available internally to PostgreSQL.

Jason

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message pxn 2002-01-17 20:54:20 backend closed the channel unexpectedly
Previous Message Stephen Ingram 2002-01-17 16:09:49 NULLs on datetime problem (for me at least :) )