Answers.Body: <p>In the CP, I don't think that's an option. The name of the variable is encryptionMethod and its value comes from database (encryptionMethod). It doesn't have an accessible value from your .env file.</p>
  <p>In your PHP code yes you can do that. You will just have to use <code>Craft::parseEnv($yourVariable);</code></p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-22T23:09:28.300Z
Answers.Text: It was added quite recently in [Craft 3.7.22](https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#3722---2021-11-23) :)
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-22T23:10:42.893Z
Answers.Text: No wonder! I guess I need to update. Dev is running 3.6.18. And thank you for that!
Answers.UserDisplayName: Tim Strawbridge
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-22T23:14:00.743Z
Answers.Text: Added a note about that to the my answer, since it's so recent – OP might be on an older version, too :)
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-22T23:02:53.063Z
Answers.LastActivityDate: 2021-12-22T23:02:53.063Z
Answers.UserDisplayName: Tim Strawbridge
Answers.Body: <p>You can name the environment variable whatever you want. The trick is that the variable's <strong><em>value</em></strong> needs to be either <code>none</code>, <code>ssl</code> or <code>tls</code> (i.e. the three options that are supported for the &quot;Encryption Method&quot; setting), for it to be selectable for that setting.</p>
  <p>For example, if you add a variable called <code>SMTP_ENCRYPTION_METHOD</code> to your <code>.env</code> file, and set its value to <code>ssl</code> (i.e. <code>SMTP_ENCRYPTION_METHOD=ssl</code>), that variable will show up as a selectable option for the &quot;Encryption Method&quot; setting:</p>
  <p><a href="https://i.sstatic.net/Ez47r.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/Ez47r.png" alt="enter image description here" /></a></p>
  <p>Note that the &quot;Use authentication&quot; setting has the same behaviour; any and all environment variables with a <em>value</em> set to one of these settings' supported options (<code>yes</code>, <code>no</code>, <code>true</code>, <code>false</code>, <code>on</code>, <code>off</code>, <code>0</code> or <code>1</code>, for the &quot;Use authentication&quot; setting) will be selectable, regardless of the actual variable name.</p>
  <p><strong>Edit:</strong> Environment variable support for the Encryption Method setting was only added in <a href="https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#3722---2021-11-23" rel="nofollow noreferrer">Craft 3.7.22</a>, so make sure you're on at least that version.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-14T16:23:48.457Z
Answers.Text: Where can one find all the possible environment variables related to SMTP in craft?
Answers.UserDisplayName: BrokenCode
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-12-14T16:56:35.353Z
Answers.Text: @BrokenCode Anything in particular you're looking for? There aren't any dedicated environment variables related to SMTP per se; only environment variable _support_ for most of the SMTP settings. The actual environment variables can be named anything.
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2021-12-22T22:49:19.290Z
Answers.LastActivityDate: 2021-12-22T23:13:09.303Z
Answers.LastEditDate: 2021-12-22T23:13:09.303Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <p>The official Craft documentation says it is possible to set the &quot;Encryption Method (SMTP)&quot; , <a href="https://i.sstatic.net/vCGhk.png" rel="nofollow noreferrer">Snipped from the documentation</a>, with an Environment Variable.</p>
  <p>I think i am missing something but i cant seem to find the exact .env Variable Name Craft is expecting for this setting.</p>
  
Tags: <craft3><emails><settings><environmentvariables>
Title: How to set SMTP Enrcyption with an environment variable
ThreadText: # How to set SMTP Enrcyption with an environment variable
  
  (Asked by: username_0 on 2021-12-22)
  
  The official Craft documentation says it is possible to set the "Encryption Method (SMTP)" , [Snipped from the documentation](https://i.sstatic.net/vCGhk.png), with an Environment Variable.
  
  I think i am missing something but i cant seem to find the exact .env Variable Name Craft is expecting for this setting.
  
  **Tags:** craft3, emails, settings, environmentvariables
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_2 on 2021-12-22. Score: 4 | Accepted answer
  
  You can name the environment variable whatever you want. The trick is that the variable's ***value*** needs to be either `none`, `ssl` or `tls` (i.e. the three options that are supported for the "Encryption Method" setting), for it to be selectable for that setting.
  
  For example, if you add a variable called `SMTP_ENCRYPTION_METHOD` to your `.env` file, and set its value to `ssl` (i.e. `SMTP_ENCRYPTION_METHOD=ssl`), that variable will show up as a selectable option for the "Encryption Method" setting:
  
  [![enter image description here](https://i.sstatic.net/Ez47r.png)](https://i.sstatic.net/Ez47r.png)
  
  Note that the "Use authentication" setting has the same behaviour; any and all environment variables with a *value* set to one of these settings' supported options (`yes`, `no`, `true`, `false`, `on`, `off`, `0` or `1`, for the "Use authentication" setting) will be selectable, regardless of the actual variable name.
  
  **Edit:** Environment variable support for the Encryption Method setting was only added in [Craft 3.7.22](https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#3722---2021-11-23), so make sure you're on at least that version.
  
  > **Comments:**
  > **username_3**: Where can one find all the possible environment variables related to SMTP in craft?  
  > **username_2**: @username_3 Anything in particular you're looking for? There aren't any dedicated environment variables related to SMTP per se; only environment variable _support_ for most of the SMTP settings. The actual environment variables can be named anything.  
  
  ---
  
  ### Answer by username_1 on 2021-12-22. Score: 1
  
  In the CP, I don't think that's an option. The name of the variable is encryptionMethod and its value comes from database (encryptionMethod). It doesn't have an accessible value from your .env file.
  
  In your PHP code yes you can do that. You will just have to use `Craft::parseEnv($yourVariable);`
  
  > **Comments:**
  > **username_2**: It was added quite recently in [Craft 3.7.22](https://github.com/craftcms/cms/blob/develop/CHANGELOG.md#3722---2021-11-23) :)  
  > **username_1**: No wonder! I guess I need to update. Dev is running 3.6.18. And thank you for that!  
  > **username_2**: Added a note about that to the my answer, since it's so recent – OP might be on an older version, too :)  
  
  ---
  
  