---json
{
"aliases": [
{ "path": ":docs:system:howto:email:smtp_connection" },
{ "path": ":howto:email:smtp_connection" }
],
"page_id": "jw1k2vwzibnp5cxuuq47b"
}
---
====== How to create a SMTP connection? ======
===== About =====
This howto shows you how to create a [[:docs:connection:smtp|smtp connection]] to a [[:docs:system:smtp|SMTP system]]
===== Attributes =====
An oracle connection supports :
* all [[:docs:connection:attribute|common connection attributes]]
* [[:docs:connection:uri|Uri]],
* user,
* [[:docs:connection:password|password]]
* ...
* and all [[:docs:connection:smtp|Smtp connection attributes]]
* Auth
* ...
===== Example =====
Here are the attributes of the [[howto:email:howto_connection_service|howto connection]]
tabul data print --type text .tabul/.tabul.yml@home | yq '.spec.connections.smtp'
comment: HowTo Smtp Connection
from: support@tabulify.com
to: support@tabulify.com
uri: smtp://localhost:1025
===== How to create =====
You can create an [[:docs:connection:smtp|Smtp connection]]:
* by directly modifying the [[#Configuration vault]]
* or by using the [[#tabul command]]
=== Secret ===
In this howto, the password is expected to be stored in the ''TABUL_MY_SMTP_PASSWORD'' [[:docs:conf:os|OS environment variable]] but there is more way to provide secrets.
To know how to pass and handle secrets, read more at [[:docs:conf:secret]]
==== Configuration Vault ====
In a [[docs:conf:tabul.yml|Configuration Vault]], to define a smtp [[docs:connection:connection|connection]] with the name ''mySmtp'', you could write:
\\
connections:
mySmtp:
uri: smtp://localhost:587
user: user
password: ${TABUL_MY_SMTP_PASSWORD}
to: Big Foo , Big Bar
from: The Tabulify
tls: true
auth: true
==== Tabul ====
With the [[docs:tabul:connection:add|tabul add command of the connection module]], adding a smtp connection with the name ''smtpConnectionName'':
tabul connection add "smtpConnectionName" "smtp://localhost:587" \
--user login \
--password '${TABUL_MY_SMTP_PASSWORD}' \
--attribute "from=tabulify@server.com"