# Kein Mailversand trotz erfolgreichem bin/console swiftmailer📧send

**URL:** <https://forum.shopware.com/t/kein-mailversand-trotz-erfolgreichem-bin-console-swiftmailersend/67897>\
**Category:** Programmierung\
**Created:** [24. Juni 2020 um 10:31 UTC](https://forum.shopware.com/t/kein-mailversand-trotz-erfolgreichem-bin-console-swiftmailersend/67897 "2020-06-24T10:31:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![thomasd\_codes](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@thomasd\_codes](https://forum.shopware.com/u/thomasd_codes)\
**Post date:** [24. Juni 2020 um 10:31 UTC](https://forum.shopware.com/t/kein-mailversand-trotz-erfolgreichem-bin-console-swiftmailersend/67897/1 "2020-06-24T10:31:23Z")

</div>

Moin!

Ich versuche eine Mail aus einem Controller heraus zu senden. Ich benutze hierfür den Shopware MailService:&nbsp;Core\Content\MailTemplate\Service\MailService

```
$data['recipients'] = [' ****@*****.de' => 'Thomas'];
$data['subject'] = "Das ist eine Testmail";
$data['senderName'] = 'Hans Wurst';
$data['contentPlain'] = 'Hans Wurst';
$data['contentHtml'] = 'Hans Wurst';
$data['salesChannelId'] = $context->getSalesChannel()->getId();
$this->mailService->send($data, $context->getContext());

```

Laut Log (mail.sent) sieht alles gut aus:

```
{
  "source": "core",
  "environment": "dev",
  "additionalData": {
    "subject": "Das ist eine Testmail",
    "contents": {
      "text/html": "Hans Wurst",
      "text/plain": "Hans Wurst"
    },
    "recipients": {
      " *******@*******.de": "Thomas"
    }
  }
}

```

Auch wenn ich den Swift-Mailer per Console-Command teste kommt die Mail sofort an:

```
 bin/console swiftmailer:email:send

```

Ich habe den Swift\_mailer im .env File per SMTP konfiguriert. In den&nbsp;Shopware-Einstellungen ist unter Settings-\>Mailer „Use environment’s configuration“ ausgewählt.

Kann mir jemand einen Tipp geben, warum die Mails nicht ankommen? Oder wie löst ihr das? Ist mein Weg vielleicht suboptimal?

Vielen Dank für eure Hilfe!

&nbsp;
