Problem sending emails with the same :from and :to domain

Hello.

I am pretty sure this isn’t actually a Kirby related problem, but maybe someone can help me out anyway:

On a client’s site, I want to send signup emails to the client’s clients, as well as to the client themselves in BCC. I am using the Kirby Courier plugin, which under the hood seems to simply employ Kirby’s built-in email() functionality. I am also using SMTP - Mailhog locally and MailerSend in production.

This is an abbreviated version of my code for sending the email:

$email = new Message();
$email
    ->from('client@client.de', 'Client')
    ->to('max@mustermann.de')
    ->replyTo('client@client.de')
    ->bcc('signups@client.de')
    ->send();

And my config:

'email' => [
        'transport' => [
            'type' => 'smtp',
            'host' => 'smtp.mailersend.net',
            'port' => 587,
            'security' => auto,
            'auth' => true,
            'username' => username,
            'password' => password
        ],
    ]

The email is successfully delivered to max@mustermann.de, but the BCC to signups@client.de isn’t going through. If I change the BCC to another email address with another domain, it works as expected.
This is happening both with Mailhog, MailerSend and even using the built-in PHP mail. I was previously using the MailerSend API, which had no problem with delivering to and from the same domain.

Does anyone have any idea what might be causing this?

I’m putting @beebmx in CC here :slight_smile:

1 Like

Hey @jonasfeige.
I reviewed the mail (with your settings), but I was unable to reproduce the error.
Is there a log or something else that I can check to help you with?

And you’re right, Kirby Courier is a wrapper for the Kirby email functionality and should work the same.

Thanks for looking into this @beebmx ! I love the plugin by the way. It seems incredibly well crafted and saves me a lot of time.

I did some further digging and think the problem is related to the domain and hosting provider (shared hosting on IONOS). Not sure where to go from here, but as expected Kirby and Courier are off the hook. :wink:

Thank you @jonasfeige