K
K
kiranananda2018-03-16 19:20:21
Laravel
kiranananda, 2018-03-16 19:20:21

Laravel mail attach and filename encodings?

Hello!
I'm trying to send files in a letter, but they come to me (on a poppy, and an iPad) with names from krakozyabrov ...
This is what happens in the letter utf-8''%D0%BF%D1%80%D0%B5%D0 %B7%D0%B8%D0%B4%D0%B5%D0%BD%D1%82.pdf
The most interesting thing on the poppy from time to time it shows the same letters with normal encoding ...
According to the latest data on gmail, the same story . Already broke my head, help me out

Mail::send('MailList::mail-send', ['data' => $msg], function($mail) 
      use($title, $email, $mailList, $message)
      {
        foreach(Content::uFile()->get($message, 'files')->files() as $file) {
          $mime = (isset($file->array_data['mime'])) ? $file->array_data['mime'] : '' ;
          $mail->attach(Storage::disk($file->disk)->getAdapter()->getPathPrefix().'/'.$file->path.$file->file, [
                        'as' => $file->orig_name,
                        'mime' => $mime,
                    ]);
        }
        $mail->to($email)->subject($title); 
       	$mail->from(Helpers::dataIsSetValue($mailList, 'email_from'), Helpers::dataIsSetValue($mailList, 'from_name'));
      });

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kiranananda, 2018-03-17
@kiranananda

In general, the cant is that even if you send yourself a letter with Russian file names from under a poppy, then the encoding is also clumsy. But the same Yandex web client also sends file names in Russian ... But it does headers a little differently.
But there is absolutely no desire to rewrite the library, so for now we have settled on the Latin alphabet ...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question