# Testing SMTP settings

**URL:** <https://forum.oxid-esales.com/t/testing-smtp-settings/98459>\
**Category:** Wiki\
**Tags:** development, english\
**Created:** [May 31, 2022, 10:42am UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459 "2022-05-31T10:42:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanilla\_thunder](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/vanilla_thunder/32/72_2.png) [@vanilla\_thunder](https://forum.oxid-esales.com/u/vanilla_thunder)\
**Post date:** [May 31, 2022, 10:42am UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459/1 "2022-05-31T10:42:29Z")

</div>

there are two options for testing your SMTP settings:

1. enter your settings in admin and send yourself a “forgot password” email. You can enable SMTP debugging in your config.inc.php but it will affect everybody in your shop, so if your shop is already live you should go with seconds option.

2. create new file in source directroy and give it a random name, so nobody can guess it, then paste this code into your file:

```auto
<?php
require_once "bootstrap.php";

$oConfig = \OxidEsales\Eshop\Core\Registry::getConfig();

$recipient = $oConfig->getRequestParameter("recipient") ;
$smtpHost = $oConfig->getRequestParameter("host");
$smtpPort = $oConfig->getRequestParameter("port");
$smtpUser = $oConfig->getRequestParameter("user");
$smtpPass = $oConfig->getRequestParameter("pass");

print '<html>
<body>
<form action="">
    <table width="">
        <tr>
            <td><input type="text" name="host" placeholder="host" value="'.$smtpHost.'" /></td>
            <td><input type="text" name="port" placeholder="port" value="'.$smtpPort.'" /></td>
            <td><input type="text" name="user" placeholder="user" value="'.$smtpUser.'" /></td>
            <td><input type="text" name="pass" placeholder="pass" value="'.$smtpPass.'" /></td>
            <td><input type="text" name="recipient" placeholder="recipient" value="'.$recipient.'" /></td>
            <td><button type="submit">📧</button></td>
        </tr>
    </table>
</form>
</body>
</html>';

if($smtpHost && $smtpPort && $smtpUser && $smtpPass && $recipient)
{
    $oEmail = oxNew(\OxidEsales\Eshop\Core\Email::class);

    $oEmail->IsSMTP();
    $oEmail->SMTPDebug = 3;
    $oEmail->SMTPAuth = true;
    $oEmail->Host = $smtpHost;
    $oEmail->Port = $smtpPort;
    $oEmail->SMTPSecure = "tls";
    $oEmail->Username = $smtpUser;
    $oEmail->Password = $smtpPass;

    $oEmail->setFrom($smtpUser);
    $oEmail->setRecipient($recipient);
    $oEmail->setSubject($smtpUser." Test Email from ".gethostname());

    $oEmail->setBody("<h1>".date("Y-m-d H:i:s")."</h1>");
    $oEmail->setAltBody(date("Y-m-d H:i:s"));

    var_dump($oEmail->send());
}

```

now you can manually enter your smtp data and test it before changing OXID settings.

---

<div class="post-metadata">

**Author:** ![Meliphagidae](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/meliphagidae/32/2466_2.png) [@Meliphagidae](https://forum.oxid-esales.com/u/Meliphagidae)\
**Post date:** [June 22, 2022, 4:30pm UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459/2 "2022-06-22T16:30:16Z")

</div>

Hallo Marat, dieses Script habe ich umgesetzt. Seither erhalte ich Fehlermeldungen im error.log:

> PHP Warning: Cannot modify header information - headers already sent by (output started at /www/htdocs/…/…/source/mein\_smtp\_test.php:27) in /www/htdocs/…/…/vendor/oxid-esales/oxideshop-ce/source/Core/UtilsServer.php on line 66

Wie bekomme ich dieses Problemchen wieder weg?

Gehostet bei All-Inkl. Community Edition 6.2.2. Quasi keine PHP -Kenntnisse.  
Danke und Grüße  
Meliphagidae

---

<div class="post-metadata">

**Author:** ![vanilla\_thunder](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/vanilla_thunder/32/72_2.png) [@vanilla\_thunder](https://forum.oxid-esales.com/u/vanilla_thunder)\
**Post date:** [June 22, 2022, 11:31pm UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459/3 "2022-06-22T23:31:32Z")

</div>

“seither” klingt komisch. Dieses Script ist eigentlich für ein einmaliges Testen gedacht und sollte danach gelöscht werden. Es sollte definitiv nicht dauerhaft auf dem Server bleiben.

---

<div class="post-metadata">

**Author:** ![Meliphagidae](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/meliphagidae/32/2466_2.png) [@Meliphagidae](https://forum.oxid-esales.com/u/Meliphagidae)\
**Post date:** [June 24, 2022, 12:27am UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459/4 "2022-06-24T00:27:12Z")

</div>

> [@vanilla\_thunder](#):
>
> “seither” klingt komisch

Naja, korrekt wäre, “ab da”. Ich hatte Probleme mit dem Kontaktformular und dieses gleich wieder nach der Nutzung des SMTP-Test-Scripts benutzt. Dann gab es diese Fehler. Heute einen Tag später konnte ich das Kontaktformular nutzen ohne Einträge in error.log, aber nur bis ich wieder das Script aufgerufen hatte. Gäbe es vielleicht eine Möglichkeit, das Script sauber zu beenden?  
Dank!

---

<div class="post-metadata">

**Author:** ![system](https://forum.oxid-esales.com/user_avatar/forum.oxid-esales.com/system/32/4245_2.png) [@system](https://forum.oxid-esales.com/u/system)\
**Post date:** [July 13, 2026, 8:37pm UTC](https://forum.oxid-esales.com/t/testing-smtp-settings/98459/5 "2026-07-13T20:37:50Z")

</div>

Closed on July 13, 2026, 8:37pm UTC


