# E-Mail with IIS - how it works

**URL:** <https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674>\
**Category:** Elements\
**Created:** [July 8, 2025, 6:43pm UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674 "2025-07-08T18:43:14Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ulrich](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ulrich/32/29764_2.png) [@Ulrich](https://forums.realmacsoftware.com/u/Ulrich)\
**Post date:** [July 8, 2025, 6:43pm UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674/1 "2025-07-08T18:43:14Z")

</div>

Email with IIS/Windows

This description applies to Elements Version 1.  
I assume that PHP in the current version 8.4.10 is installed and the following extensions are enabled:

- php\_curl.dll
- php\_fileinfo.dll
- php\_mbstring.dll
- php\_openssl.dll

1. The .htaccess file must be converted to web.config for IIS.
2. In the directory /rw/elements/com.realmac.corepack/api, a log directory must be created and the IUSR user must have write permissions in it.
3. The option “SMTP server does not require authentication” is missing. Therefore, adapt the file ./backend/rw\*/config.php (under the contact form). This could be set if no username and password are provided!

#### /rw/elements/com.realmac.corepack/api/web.config

```auto
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
  <system.webServer>
    <!-- Standard-Dokument -->
    <defaultDocument>
      <files>
        <add value="index.php" />
      </files>
    </defaultDocument>

    <!-- Umschreiben aller Anfragen auf index.php, falls Datei/Verzeichnis nicht existiert -->
    <rewrite>
      <rules>
        <rule name="Rewrite to index.php" stopProcessing="true">
          <match url="^(.*)$" />
          <conditions>
            <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
            <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
          </conditions>
          <action type="Rewrite" url="index.php/{R:1}" />
        </rule>
      </rules>
    </rewrite>
  </system.webServer>
</configuration>

```

#### /kontakt/backend/rw094859745987345987345/config.php

```auto
<?php

return [
    'email' => [
        'enabled' => '1' === '1',
        'to' => 'to@domain.tld',
        'subject' => 'Subject',
        'template' => 'default',
        'from_email' => 'from@domain.tld',
        'from_name' => 'From Name',
        'smtp_host' => 'smtp.domain.tld',
        'smtp_port' => '25',
        'smtp_username' => '',
        'smtp_password' => '',
        'smtp_encryption' => 'none', // tls, ssl, or none
        'smtp_auth' => false,
        'smtp_timeout' => 30,
        'charset' => 'UTF-8',
    ],
...

```

---

<div class="post-metadata">

**Author:** ![Ulrich](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ulrich/32/29764_2.png) [@Ulrich](https://forums.realmacsoftware.com/u/Ulrich)\
**Post date:** [September 5, 2025, 10:16am UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674/2 "2025-09-05T10:16:13Z")

</div>

Forms with EMail works fine.

Could you please add the `web.config` in `\rw\elements\com.realmac.corepack\api` ? @dan

---

<div class="post-metadata">

**Author:** ![dan](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/dan/32/28516_2.png) [@dan](https://forums.realmacsoftware.com/u/dan)\
**Post date:** [September 5, 2025, 3:03pm UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674/3 "2025-09-05T15:03:34Z")

</div>

Hmmm, that’s one for @ben to take a look at… is this possible?

---

<div class="post-metadata">

**Author:** ![Ulrich](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/ulrich/32/29764_2.png) [@Ulrich](https://forums.realmacsoftware.com/u/Ulrich)\
**Post date:** [September 9, 2025, 10:17am UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674/4 "2025-09-09T10:17:14Z")

</div>

Solution:  
Create folders and add file.

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/realmacsoftware1/original/3X/6/2/62949356faafd20b03dfdc5f21ce50e8116f8e4b.png)

---

<div class="post-metadata">

**Author:** ![scottsteven](https://dub1.discourse-cdn.com/flex005/user_avatar/forums.realmacsoftware.com/scottsteven/32/3418_2.png) [@scottsteven](https://forums.realmacsoftware.com/u/scottsteven)\
**Post date:** [September 9, 2025, 1:45pm UTC](https://forums.realmacsoftware.com/t/e-mail-with-iis-how-it-works/48674/5 "2025-09-09T13:45:40Z")

</div>

It needs to be able to **edit the configuration similar to how we do with .htaccess** , not just push changes.

In my setup, I rely on many .htaccess rules, and I use the IIS Import tool to bring those rules into the web.config file.

Yes I manage windows servers for a client. No I do not use them in my own company or personally.
