# Troubleshooting Contact Form | Email delivery fails to strict servers

**URL:** <https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566>\
**Category:** Questions\
**Tags:** v4\
**Created:** [January 23, 2024, 9:20am UTC](https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566 "2024-01-23T09:20:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![aronaugust](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aronaugust/32/14341_2.png) [@aronaugust](https://forum.getkirby.com/u/aronaugust)\
**Post date:** [January 23, 2024, 9:20am UTC](https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566/1 "2024-01-23T09:20:17Z")

</div>

Hello Community!

I’ve tried solving this for the past 12 hours, and I’ve decided to ask for help.

I’ve set up an SMTP connection in my **config/config.php** for Mailjet. I’ve tested it with **telnet** in my terminal, and my credentials are **correct**. When sending to a less strict domain like Tutanota, it works fine. However when sending to Gmail or Ionos servers, the message never arrives. I’ve tried adding a SENDER header, I’ve tried using the same FROM and REPLY TO headers. It does not seem to fix the issue.

What would be the best way to troubleshoot this? I don’t think it’s related to SPIF/DKIM/DMARC/MX, because the same SMTP commands worked when used in telnet.

Liebe Grüße aus Wien

---

<div class="post-metadata">

**Author:** ![aronaugust](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aronaugust/32/14341_2.png) [@aronaugust](https://forum.getkirby.com/u/aronaugust)\
**Post date:** [January 23, 2024, 9:37am UTC](https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566/2 "2024-01-23T09:37:41Z")

</div>

**Update:**

I checked again in Tutanota, where the mail got delivered. The email seems to be sent with Postfix from my server instead of Mailjet SMTP. Have I overlooked something in my config/config.php?

```auto
<?php

return [
    'debug' => true,
    'languages' => true,
    'languages.detect' => true,
    'email' => [
        'transport' => [
            'type' => 'stmp',
            'host' => 'in-v3.mailjet.com',
            'port' => '587',
            'security' => 'true',
            'auth' => 'true',
            'username' => 'APIKEY',
            'password' => 'SECRETKEY',
        ]
    ]
];

```

Bzw. do I need to add something to the controller?

```auto
$success = $kirby->email([
                        'template' => 'contact',
                        'from' => 'me@mydomain.eu',
                        'replyTo' => $data['email'],
                        'to' => 'me@mydomain.eu',
                        'subject' => '[CONTACT FORM] ' . esc($data['name']) . ' sent you a message',
                        'data' => [
                            'text' => esc($data['text']),
                            'sender' => esc($data['name']),
                            'email' => esc($data['email'])
                        ]
                    ])->isSent();

```

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [January 23, 2024, 9:55am UTC](https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566/3 "2024-01-23T09:55:50Z")

</div>

> [@aronaugust](#):
>
> ` 'security' => 'true',`

First thing that meets the eye: This must be a boolean not a string.

---

<div class="post-metadata">

**Author:** ![aronaugust](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/aronaugust/32/14341_2.png) [@aronaugust](https://forum.getkirby.com/u/aronaugust)\
**Post date:** [January 23, 2024, 10:16am UTC](https://forum.getkirby.com/t/troubleshooting-contact-form-email-delivery-fails-to-strict-servers/30566/4 "2024-01-23T10:16:15Z")

</div>

Hey Sonja,  
thank you for your quick reply! Apart from the booleans, I also misspelled SMTP in the config file. What a stupid mistake, seems like I was overthinking the issue haha

Now everything works as intended! Thanks for the help!
