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

Unable to specify charset for Content-Type header #14

Open
basz opened this issue Aug 6, 2013 · 6 comments
Open

Unable to specify charset for Content-Type header #14

basz opened this issue Aug 6, 2013 · 6 comments

Comments

@basz
Copy link

basz commented Aug 6, 2013

Mime type is automaticly guessed by SxMail. When the mimetype is text/html hoewever we are unable to specify a charset, which may result in incorrectly characters.

Workaround seem to be to use htmlentities within the view as setting the Content-Type via the header result in two Content-Type headers. Apple's Mail uses the first one mentioned in source, which is not mine.

@RWOverdijk
Copy link
Member

That is a problem. It should be possible to set the charset, but if I remember correctly Zend\Mail made that pretty difficult to do. If it doesn't, you can use the body returned by SxMail::compose() to set it yourself. If you do, please be kind enough to leave me a snippet or PR2, that would be awesome. I'm currently not working on mail so it's a bit difficult to work on this within a decent amount of time.

ps: You can specify the mime-type, too. It only guesses when you don't supply one.

@basz
Copy link
Author

basz commented Aug 7, 2013

ps: You can specify the mime-type, too. It only guesses when you don't supply one.

You are right - when I do

$sxMail->compose($viewModel, 'text/html; charset=utf-8');

i get this in the header of the email

Content-Type: text/html; charset=utf-8

Which is precisely what I needed.

@basz basz closed this as completed Aug 7, 2013
@RWOverdijk
Copy link
Member

I would like to keep this issue open, so I can implement something a bit nicer at some point.

@RWOverdijk RWOverdijk reopened this Aug 8, 2013
@e-belair
Copy link
Contributor

e-belair commented Sep 4, 2013

I forked the repos and added the charset config support
SImply added charset key and set the MimeParts charset

@RWOverdijk
Copy link
Member

@manuscle If it works would you mind submitting a PR?

@RWOverdijk
Copy link
Member

@manuscle bump?

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

No branches or pull requests

3 participants