Emails not being sent on live server / Transactional email provider recommendation?

Working on a shop with Merx. For some reason, confirmation emails are not being sent from my live “staging” server, but it’s working on local server with the exact same configuration:

'email' => [
  'transport' => [
    'type' => 'smtp',
    'host' => $_ENV['SHOP_EMAIL_HOST'], // smtp.ionos.de
    'port' => $_ENV['SHOP_EMAIL_PORT'], // 587
    'security' => 'tls',
    'auth' => true,
    'username' => $_ENV['SHOP_EMAIL_USER'], // my@email.address
    'password' => $_ENV['SHOP_EMAIL_PASS'], // password
  ]
],

I’ve also tried setting 'security' => 'ssl', 'port' => '465', which also works on localhost but not on the live server. With both settings it just goes into a very long loading cycle and after about a minute redirects to the correct page, but without sending the confirmation mails.

I wonder if there are server settings in place which prevent phpmailer from working (although it has worked well in the past on the same server), but no idea which it might be…

I doubt that it is a problem with the mail provider (in this case just a plain shared hosting on ionos) because it’s working from localhost as mentioned, but in any case, does anybody have a recommendation for a transactional mail provider? My client is using mailchimp but their standard plan is too expensive.

Hmm, what is the possibility that the Restrict outgoing SMTP setting is enabled on your server?

I don’t know – let me contact support and find out! :~)

Edit:

Ralph
It is not allowed if you are using our servers and your files are with us.
If you want to use ionos, then you must their MX record for this.

Does that make sense? I have no idea about servers. Does this mean I can only use my hosting provider’s servers for email sending?

But anyhow… I guess this problem might be resolved once we move the site to its final destination on the ionos server (where the mails are being sent as well), do you think so?

Actually I do not believe that this makes sense but I would need to think more about it. My first impression ist, that the SMTP server you are trying to contact (smtp.ionos.de?) is not accepting the “call” from your specific server, maybe because its IP has made it on some blacklist for any reason. If this is true (and you could test it by contacting the ionos server from your other server interactively) then this problem should in fact disappear when you have moved the site to ionos.

Thanks for the reply! The issue is in fact gone, now that the site is live on ionos. Strange behavior nevertheless. Time for me to stop using 74862 different shared hosting providers, there’s always issues… :smiley:

1 Like