Home > Archive > PostgreSQL Documentation > December 2005 > sending mail from Postgres









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author sending mail from Postgres
Aftab Alam

2005-12-31, 3:23 am

Hi there,

How can i send mail form postgresql.

any suggestion.

thanx & regards

aftab









Christopher Browne

2005-12-31, 1:23 pm

> How can i send mail form postgresql.

You shouldn't try to do this directly.

What you should do is to set up a table into which you can inject
messages that are to be sent.

A separate process looks for messages that haven't been sent yet,
submits them to your favorite SMTP daemon, and marks them as sent.
The "simple" way is for the process to poll the table (perhaps
sleeping a minute or two between invocations); more sophisticated is
for it to LISTEN for notifications, and for message injection to cause
a NOTIFY to immediately wake up the transport daemon.

This approach is robust, scalable, and allows your "message transport"
process to manage things as carefully as they need to be managed.
--
output = ("cbbrowne" "@" "gmail.com")
http://linuxdatabases.info/info/slony.html
Rules of the Evil Overlord #225. "I will explain to my guards that
most people have their eyes in the front of their heads and thus while
searching for someone it makes little sense to draw a weapon and
slowly back down the hallway." <http://www.eviloverlord.com/>
Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com