K
K
KoiGva2015-11-17 22:08:57
Character encoding
KoiGva, 2015-11-17 22:08:57

Laravel 5 how to encode To: field when sending mail Mail::send()?

There is this code:

Mail::send('emails.email', [], function($message) {
   $message->
   subject('Тестовое письмо')->
   from('[email protected]', 'Имя отправителя')->
   to('[email protected]', 'Имя получателя');
});

If the recipient's name is written in Cyrillic in the To: field, then the letter does not arrive.
Do I need to encode this field myself?
If so, how?
All sources are in UTF-8 without BOM.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
KoiGva, 2015-11-17
@koigva

This helped:

to('[email protected]', '=?utf-8?B?'.base64_encode('Имя получателя').'?=');

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question