# pg_utl_smtp 2.0 adds async mode and TLS for PostgreSQL email notifications

> **Key takeaway:** The Oracle-compatible PostgreSQL extension pg_utl_smtp has released version 2.0 with asynchronous email sending, SSL/TLS support, and stricter SMTP error handling.

**Published:** 2026-10-18T00:00:00+00:00 
**Source:** PostgreSQL Official News 
**Category:** databases-storage 
**Canonical URL:** https://fosswire.org/news/pgutlsmtp-20-adds-async-mode-and-tls-for-postgresql-email-no.html 

## Summary
pg_utl_smtp 2.0.0 brings asynchronous email delivery to PostgreSQL, a capability not present in Oracle's original UTL_SMTP package. The release also adds SSL/TLS connections, fixes duplicate EHLO commands, and raises errors on SMTP failures during any protocol stage. The extension lets triggers and stored procedures send email directly, enabling data-driven alerts without application-layer involvement.

## What's new in pg_utl_smtp 2.0
- **Asynchronous mode**: New `pg_utl_smtp.asynchronous` setting enables non-blocking email sends, useful for porting MSSQL's `sp_send_dbmail()`
- **SSL/TLS support**: `secure_connection_before_smtp` parameter encrypts SMTP connections
- **Stricter error handling**: SMTP errors during HELO/EHLO, MAIL, RCPT, DATA, end-of-DATA, or QUIT now raise PostgreSQL errors instead of failing silently
- **Connection fixes**: Eliminated duplicate EHLO at connection start; QUIT properly releases connection, second QUIT raises error
- **CI/testing**: GitHub Actions regression tests added
- **Upgrade path**: `ALTER EXTENSION pg_utl_smtp UPDATE` for existing installations

## Why it matters
The async mode and TLS support make this extension more viable for production alerting pipelines. It remains particularly relevant for organizations migrating from Oracle or SQL Server to PostgreSQL who need to preserve database-driven email notification patterns.