pg_smtp_client
PostgreSQL extension to send email using SMTP
pg_smtp_client : PostgreSQL extension to send email using SMTP
Overview
| ID | Extension | Package | Version | Category | License | Language |
|---|---|---|---|---|---|---|
| 4170 | pg_smtp_client | pg_smtp_client | 0.2.1 |
UTIL | MIT | Rust |
| Attribute | Has Binary | Has Library | Need Load | Has DDL | Relocatable | Trusted |
|---|---|---|---|---|---|---|
| --s-d-- | No | Yes | No | Yes | no | no |
| Relationships | |
|---|---|
| Schemas | smtp_client |
| See Also | pg_html5_email_address emailaddr pg_utl_smtp omni_email uri ip4r url_encode |
Packages
| Type | Repo | Version | PG Major Compatibility | Package Pattern | Dependencies |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.2.1 |
18 17 16 15 14 | pg_smtp_client |
- |
| RPM | PIGSTY | 0.2.1 |
18 17 16 15 14 | pg_smtp_client_$v |
- |
| DEB | PIGSTY | 0.2.1 |
18 17 16 15 14 | postgresql-$v-pg-smtp-client |
- |
| Linux / PG | PG18 | PG17 | PG16 | PG15 | PG14 |
|---|---|---|---|---|---|
| el8.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| el8.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| el9.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| el9.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| el10.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| el10.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| d12.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| d12.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| d13.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| d13.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u22.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u22.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u24.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u24.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u26.x86_64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
| u26.aarch64 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 | PIGSTY 0.2.1 |
Source
github.com/brianpursley/pg_smtp_client
pg_smtp_client-0.2.1.tar.gz
Install
Make sure PGDG and PIGSTY repo available:
Install this extension with pig:
Create this extension with:
Usage
Enabling the extension
Connect to postgres and run the following command.
Use the smtp_client.send_email() function to send an email.
Function Parameters
| Parameter | Type | Description | System Configuration (Optional) |
|---|---|---|---|
| subject | text | The subject of the email | |
| body | text | The body of the email | |
| html | boolean | Whether the body is HTML (true) or plain text (false) | |
| from_address | text | The from email address | smtp_client.from_address |
| recipients | text[] | The email addresses of the recipients | |
| ccs | text[] | The email addresses to CCs | |
| bccs | text[] | The email addresses to BCCs | |
| smtp_server | text | The SMTP server to use | smtp_client.server |
| smtp_port | integer | The port of the SMTP server | smtp_client.port |
| smtp_tls | boolean | Whether to use TLS | smtp_client.tls |
| smtp_username | text | The username for the SMTP server | smtp_client.username |
| smtp_password | text | The password for the SMTP server | smtp_client.password |
Default Configuration
You can configure the following system-wide default values for some of the parameters (as indiciated in the table above) like this:
Usage Examples
Send an email:
Send an email using configured default values:
Or, using named arguments: