Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Easier encoder configuration for symfony/mailer #44557

Closed
exeba opened this issue Dec 10, 2021 · 3 comments
Closed

Easier encoder configuration for symfony/mailer #44557

exeba opened this issue Dec 10, 2021 · 3 comments

Comments

@exeba
Copy link

exeba commented Dec 10, 2021

Description

Using the old swift mailer I was able to do:

        $message = (new \Swift_Message())
            ->setEncoder(new \Swift_Mime_ContentEncoder_PlainContentEncoder('8bit'))
            ->setMaxLineLength(1000) 

So far, the only way I found to do the same thing with symfony/mailer is to extend Symfony\Component\Mime\Email. in particular this method:

    public function getBody(): AbstractPart
    {
        return new TextPart($this->getTextBody(), $this->getTextCharset(), 'plain', '8bit');
    }

Example

It would be maybe nice to extend the current text() method and add an encoder param?

    $message = (new Email())->text($longLine, 'utf-8', $myCustomEncoder);
@carsonbot
Copy link

Thank you for this suggestion.
There has not been a lot of activity here for a while. Would you still like to see this feature?

@carsonbot
Copy link

Friendly reminder that this issue exists. If I don't hear anything I'll close this.

@carsonbot
Copy link

Hey,

I didn't hear anything so I'm going to close it. Feel free to comment if this is still relevant, I can always reopen!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants