# Mails not sending

**URL:** <https://forum.mautic.org/t/mails-not-sending/19934>\
**Category:** Product Support\
**Tags:** development, mautic-3\
**Created:** [June 22, 2021, 2:55pm UTC](https://forum.mautic.org/t/mails-not-sending/19934 "2021-06-22T14:55:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bas](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/bas/32/547_2.png) [@bas](https://forum.mautic.org/u/bas)\
**Post date:** [June 22, 2021, 2:55pm UTC](https://forum.mautic.org/t/mails-not-sending/19934/1 "2021-06-22T14:55:54Z")

</div>

**Your software**  
My Mautic version is: 3.3.3  
My PHP version is: 7.4.18  
My Database type and version is: MySQL 8.0.25-0ubuntu0.20.04.1

**Your problem**  
_My problem is:_  
We have a Mautic instance running with Mailjet as mail provider, which has always served us nicely, but about 2-3 weeks ago, we started getting problems.

Some mails that are send by a campaign in Mautic don’t get send for a while. Even when they retry they sometimes fail for the same reason.

The weird thing is that sending test mails to myself and even from when I join the campaign myself I receive the emails. This goes for sending test mails from the mail setting menu, as well as the mail sent by the campaigns which give those errors

We have the retry campaign event set up for 30 minutes and sometimes after 30mins it does get sent, but other times it doesn’t. This is all happening without any consistency.

_These errors are showing in the log:_

```php
[2021-06-22 11:40:31] mautic.ERROR: [MAIL ERROR] Expected response code 250 but got an empty response (send); somemail@mail.com {"exception":"[object] (Swift_TransportException(code: 0): Expected response code 250 but got an empty response at /var/www/vhosts/domain.com/htdocs/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:445)"} []
[2021-06-22 11:40:31] mautic.ERROR: [MAIL ERROR] Expected response code 354 but got an empty response (send); othermail@mail.com {"exception":"[object] (Swift_TransportException(code: 0): Expected response code 354 but got an empty response at /var/www/vhosts/domain.com/htdocs/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:445)"} []

```

_These errors are not showing in the log, but sometimes when I run the job myself rather than running it by cron:_

```php
PHP Warning: fwrite(): SSL operation failed with code 1. OpenSSL Error messages:
error:1409E10F:SSL routines:ssl3_write_bytes:bad length in /var/www/vhosts/domain.com/htdocs/mautic/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php on line 231

```

Unfortunately I cannot see why this is happening and more importantly why this only happens sometimes.

_Steps I have tried to fix the problem:_  
Reset the mail config and used another Mailjet account.

**Another thing I found**  
Since the campaign event has errored, you would expect the next events to not execute until this one is executed successfully. The last action in some of these campaign is removing the contact from the campaign after 1 hour, but sometimes this happens before the mail can be send. In this case the contact is removed from the campaign before the mail is sent, so the mail will never try to get sent again.

---

<div class="post-metadata">

**Author:** ![ahmadmushtaq](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ahmadmushtaq/32/6397_2.png) [@ahmadmushtaq](https://forum.mautic.org/u/ahmadmushtaq)\
**Post date:** [December 5, 2021, 1:34am UTC](https://forum.mautic.org/t/mails-not-sending/19934/2 "2021-12-05T01:34:32Z")

</div>

I am following similar issue and I have detailed about it in this post:  
[https://forum.mautic.org/t/command-swiftmailersend-exited-with-status-code-1/21905/3](https://forum.mautic.org/t/command-swiftmailersend-exited-with-status-code-1/21905/3)
