great-crayon-86888
02/05/2024, 10:48 AMchilly-king-10285
02/05/2024, 10:48 AMchilly-king-10285
02/05/2024, 10:49 AMconfig.yml
file. Here are the steps: 1. If your SMTP server enforces certificate-based authentication, configure the client certificate and client private key to use to connect to the server. The files must contain PEM encoded data. Here is an example of how to do this: yaml # kratos -c path/to/my/kratos/config.yml serve courier: smtp: client_cert_path: /somepath/client.cert client_key_path: /somepath/client.key
[Source](https://www.ory.sh/docs/kratos/self-hosted/mail-courier-selfhosted#certificate-based-authentication) 2. If your SMTP server requires a unique identifier for the HELO/EHLO command, configure the identifier. The identifier should usually be the domain name of the sending host. If the identifier is not configured, localhost
is used per default. Here is an example: yaml courier: smtp: local_name: <http://example.org|example.org>
[Source](https://www.ory.sh/docs/kratos/self-hosted/mail-courier-selfhosted#custom-smtp-heloehlo-identifier) 3. You can also configure custom SMTP headers. For example, if integrating with AWS SES SMTP interface, the headers can be configured for cross-account sending: yaml # kratos -c path/to/my/kratos/config.yml serve courier: smtp: headers: X-SES-SOURCE-ARN: arn:aws:ses:us-west-2:123456789012:identity/example.com X-SES-FROM-ARN: arn:aws:ses:us-west-2:123456789012:identity/example.com X-SES-RETURN-PATH-ARN: arn:aws:ses:us-west-2:123456789012:identity/example.com
[Source](https://www.ory.sh/docs/kratos/self-hosted/mail-courier-selfhosted#custom-smtp-headers) 4. To send emails from your server, follow these steps to configure Ory to use a custom SMTP server: - Sign in to the [Ory Console](https://console.ory.sh/projects/current/email-configuration) and go to Customize → Email Configuration. Toggle the Advanced Settings switch and provide the configuration for your SMTP server. - Download the Ory Identities config from your project and save it to a file: bash ## List all available projects ory list projects ## Get config ory get identity-config {project-id} --format yaml > identity-config.yaml
- Add the configuration for your custom SMTP server: yaml courier: smtp: connection_uri: <smtp://username:password@server:port/> from_address: [email protected] from_name: My Company
- Update the Ory Identities configuration using the file you worked with: bash ory update identity-config {project-id} --file updated_config.yaml
[Source](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp) Remember to replace the placeholders with your actual data.great-crayon-86888
02/05/2024, 11:21 AMchilly-king-10285
02/05/2024, 11:21 AMchilly-king-10285
02/05/2024, 11:21 AMconnection_uri
field in the configuration file. Here is an example: yaml courier: smtp: connection_uri: <smtp://username:password@server:port/>
In this example, replace username
, password
, server
, and port
with your actual SMTP server details. The username
and password
are your SMTP server credentials, server
is your SMTP server address, and port
is the port number your SMTP server is listening on. For example, if you are using Mailgun, your connection_uri
might look like this: yaml connection_uri: <smtp://some-user%40mailgun.example.org:[email> protected]:587
[Source](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp#integrations)great-crayon-86888
02/06/2024, 7:33 AMchilly-king-10285
02/06/2024, 7:33 AMchilly-king-10285
02/06/2024, 7:33 AMyaml courier: smtp: connection_uri: <smtp://myusername:mypassword@smtp.example.com:587/> from_address: [email protected] from_name: My Company
In this example: - myusername
and mypassword
are your SMTP server credentials. - <http://smtp.example.com|smtp.example.com>
is your SMTP server address. - 587
is the port number your SMTP server is listening on. - [email protected]
is the email address that will appear as the sender of the emails. - My Company
is the name that will appear as the sender of the emails. Please replace the placeholders with your actual data. [Source](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp)great-crayon-86888
02/06/2024, 7:34 AMchilly-king-10285
02/06/2024, 7:34 AMchilly-king-10285
02/06/2024, 7:34 AMfrom_address
is the email address that will appear as the sender of the emails. Here is an example: yaml courier: smtp: from_address: [email protected]
In this example, [email protected]
is the email address that will appear as the sender of the emails. You should replace [email protected]
with your actual email address. [Source](https://www.ory.sh/docs/kratos/emails-sms/sending-emails-smtp)