# Anonymous SMTP Authentication Setup

To configure anonymous authentication for SMTP, please make the following changes to your **app service** environment variables:

### **Remove These Environment Variables:**

These are used for authenticated SMTP and **should be removed** for anonymous authentication:

* `SMTP_USERNAME=""`
* `SMTP_API_KEY=""`

### **Add or ensure these environment variables are set on the App Service:**

<table><thead><tr><th width="302.88885498046875">Environment Variable</th><th>Description</th></tr></thead><tbody><tr><td><code>SMTP_HOST</code></td><td>This is the hostname or IP address of your SMTP email server (e.g., <code>mail.contoso.com</code>).</td></tr><tr><td><code>SMTP_PORT</code></td><td>This is the port number that your email server uses for communication. Common ports for SMTP include <code>25</code> , <code>465</code> (recommended for encrypted communication) or <code>587</code>.</td></tr><tr><td><code>SMTP_SERVICE</code></td><td>Set this to <code>custom</code> for anonymous authentication setup.</td></tr><tr><td><code>SMTP_REQUIRE_TLS</code></td><td>This variable is to indicate whether TLS is enabled on the server or not. Accepted values include <code>0</code> (No) or <code>1</code>(Yes).</td></tr><tr><td><code>SMTP_TLS_ENABLED</code></td><td>This defines whether the SMTP connection should use TLS. Accepted values include <code>0</code> (No) or <code>1</code> (Yes).</td></tr><tr><td><code>FROM_EMAIL_ADDRESS</code></td><td>The email address from which emails will be sent. Example: <code>noreply@yourdomain.com</code>.</td></tr><tr><td><code>DKIM_DOMAIN_NAME</code></td><td>(If applicable) Your domain name used for DKIM signing. Example: <code>yourdomain.com</code>.</td></tr></tbody></table>
