Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

stevemoretz's avatar

Laravel 10 mail send automatic text version of HTML

Does Laravel convert the html version of the email to text and send that? That's what I want to happen, I don't want to define a text template for it as well.

I thought it does it by default but trying mailsender and Laravel and trying to send an email I got an error:

MailerSend \ Exceptions \ MailerSendAssertException
One of template_id or text must be supplied

Tracking it down I found out in vendor/mailersend/laravel-driver/src/MailerSendTransport.php

dd($message->getTextBody());

returns null, so that made my understand I needed to define text as well to get rid of the error:

    public function content(): Content
    {
        return new Content(
            view: "mail.example",
            text: "mail.example"
        );
    }

But I don't want that, I mean I'm fine if I can just give it the same html template and it converts it but not if it doesn't, so what's the best way to handle this?

0 likes
2 replies

Please or to participate in this conversation.