pg.ddx.io pgsql-docs@postgresql.org mailing list archive
help / color / mirror / Atom feedsending mail from Postgres
5+ messages / 4 participants
[nested] [flat]
* sending mail from Postgres
@ 2005-12-28 03:22 Aftab Alam <aalam@tatashare.com>
2005-12-28 04:30 ` Re: sending mail from Postgres Jeremy Drake <jeremyd@apptechsys.com>
2005-12-28 05:20 ` Re: sending mail from Postgres Pavel Stehule <pavel.stehule@hotmail.com>
2005-12-29 04:53 ` Re: sending mail from Postgres David Fetter <david@fetter.org>
0 siblings, 3 replies; 5+ messages in thread
From: Aftab Alam @ 2005-12-28 03:22 UTC (permalink / raw)
To: pgsql-hackers@postgresql.org
Hi there,
How can i send mail form postgresql.
any suggestion.
thanx & regards
aftab
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <aalam@tatashare.com>
@ 2005-12-28 04:30 ` Jeremy Drake <jeremyd@apptechsys.com>
2 siblings, 0 replies; 5+ messages in thread
From: Jeremy Drake @ 2005-12-28 04:30 UTC (permalink / raw)
To: Aftab Alam <aalam@tatashare.com>; +Cc: pgsql-hackers@postgresql.org
Code from perl cookbook, wrapped in plperlu wrapper
not very portable, Net::SMTP would probably be better, and result in more
portable perl code.
Didn't test this - but it is copied straight from perl cookbook via
google: http://www.unix.org.ua/orelly/perl/cookbook/ch18_04.htm
CREATE OR REPLACE FUNCTION send_email(from_address text, to_address text,
subject text, body text) RETURNS void AS $$
use Mail::Mailer;
my ($from_address, $to_address, $subject, $body) = @_;
my $mailer = Mail::Mailer->new("sendmail");
$mailer->open({ From => $from_address,
To => $to_address,
Subject => $subject,
})
or die "Can't open: $!";
print $mailer $body;
$mailer->close();
$$ LANGUAGE plperlu VOLATILE STRICT;
On Wed, 28 Dec 2005, Aftab Alam wrote:
> Hi there,
>
> How can i send mail form postgresql.
>
> any suggestion.
>
> thanx & regards
> aftab
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
--
Don't steal; thou'lt never thus compete successfully in business. Cheat.
-- Ambrose Bierce
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <aalam@tatashare.com>
@ 2005-12-28 05:20 ` Pavel Stehule <pavel.stehule@hotmail.com>
2 siblings, 0 replies; 5+ messages in thread
From: Pavel Stehule @ 2005-12-28 05:20 UTC (permalink / raw)
To: aalam@tatashare.com; pgsql-hackers@postgresql.org
Hello,
it depend on your possibilities. Simply, use PL/Perl or PL/sh.
Regards
Pavel Stehule
or use PgSendMail
http://sourceforge.net/project/showfiles.php?group_id=35804
>
>Hi there,
>
>How can i send mail form postgresql.
>
>any suggestion.
>
>thanx & regards
>aftab
>
>---------------------------(end of broadcast)---------------------------
>TIP 6: explain analyze is your friend
_________________________________________________________________
Citite se osamele? Poznejte nekoho vyjmecneho diky Match.com.
http://www.msn.cz/
^ permalink raw reply [nested|flat] 5+ messages in thread
* Re: sending mail from Postgres
2005-12-28 03:22 sending mail from Postgres Aftab Alam <aalam@tatashare.com>
@ 2005-12-29 04:53 ` David Fetter <david@fetter.org>
2 siblings, 0 replies; 5+ messages in thread
From: David Fetter @ 2005-12-29 04:53 UTC (permalink / raw)
To: Aftab Alam <aalam@tatashare.com>; +Cc: pgsql-hackers@postgresql.org
On Wed, Dec 28, 2005 at 08:52:41AM +0530, Aftab Alam wrote:
> Hi there,
>
> How can i send mail form postgresql.
Generally, it is a better idea either to poll your PostgreSQL database
and send mail based on that, or use LISTEN/NOTIFY, rather than
directly sending mail from your database.
Cheers,
D
--
David Fetter david@fetter.org http://fetter.org/
phone: +1 415 235 3778
Remember to vote!
^ permalink raw reply [nested|flat] 5+ messages in thread
* sending mail from Postgres
@ 2005-12-28 03:22 Aftab Alam <aalam@tatashare.com>
0 siblings, 0 replies; 5+ messages in thread
From: Aftab Alam @ 2005-12-28 03:22 UTC (permalink / raw)
To: pgsql-docs
Hi there,
How can i send mail form postgresql.
any suggestion.
thanx & regards
aftab
^ permalink raw reply [nested|flat] 5+ messages in thread
end of thread, other threads:[~2005-12-29 04:53 UTC | newest]
Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-12-28 03:22 sending mail from Postgres Aftab Alam <aalam@tatashare.com>
2005-12-28 04:30 ` Jeremy Drake <jeremyd@apptechsys.com>
2005-12-28 05:20 ` Pavel Stehule <pavel.stehule@hotmail.com>
2005-12-29 04:53 ` David Fetter <david@fetter.org>
2005-12-28 03:22 sending mail from Postgres Aftab Alam <aalam@tatashare.com>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox