Hi Raphael Why don't you simply use $query = "insert into member values('Jim Jones', '21', 'passw', 'jim@bfr.com');"; if ( mail(jim@bfr.com, "Welcome", "", "")) { pg_query($connId, $query); } else { echo 'Mail could'nt be delivered.'; } If the mail() function workes properly then the record will be inserted. If mail() failed a message will be issued. Regards Conni -- PHP Database Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php