pg_smtp_client
PostgreSQL extension to send email using SMTP
Repository
brianpursley/pg_smtp_client
https://github.com/brianpursley/pg_smtp_client
Source
pg_smtp_client-0.2.1.tar.gz
pg_smtp_client-0.2.1.tar.gz
Overview
| Package | Version | Category | License | Language |
|---|---|---|---|---|
pg_smtp_client | 0.2.1 | UTIL | MIT | Rust |
| ID | Extension | Bin | Lib | Load | Create | Trust | Reloc | Schema |
|---|---|---|---|---|---|---|---|---|
| 4170 | pg_smtp_client | No | Yes | No | Yes | No | No | smtp_client |
Version
| Type | Repo | Version | PG Ver | Package | Deps |
|---|---|---|---|---|---|
| EXT | PIGSTY | 0.2.1 | 1817161514 | pg_smtp_client | - |
| RPM | PIGSTY | 0.2.1 | 1817161514 | pg_smtp_client_$v | - |
| DEB | PIGSTY | 0.2.1 | 1817161514 | postgresql-$v-pg-smtp-client | - |
Build
You can build the RPM / DEB packages for pg_smtp_client using pig build:
Install
You can install pg_smtp_client directly. First, make sure the PGDG and PIGSTY repositories are added and enabled:
Install the extension using pig or apt/yum/dnf:
Install
pig
dnf
apt
Create Extension:
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:
Was this page helpful?
Thanks—your feedback helps us improve this page.
What got in the way? (optional)