質問するログイン新規登録

質問編集履歴

3

画像追加

2018/03/27 05:30

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -99,4 +99,8 @@
99
99
  }
100
100
  });
101
101
  }
102
- ```
102
+ ```
103
+
104
+ 複数送信できたのですが、ファイル名が文字化けしてしまいます。
105
+
106
+ ![文字化け](5f3adf294e439c9dc4492879e7f21b12.jpeg)

2

ソース修正

2018/03/27 05:30

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -28,12 +28,12 @@
28
28
  $temp6 = $request->input('temp6');
29
29
 
30
30
 
31
- $filepath1 = "/".$username."/".$temp1;
31
+ $filepath1 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp1,'SJIS-win','UTF-8');
32
- $filepath2 = "/".$username."/".$temp2;
32
+ $filepath2 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp2,'SJIS-win','UTF-8');
33
- $filepath3 = "/".$username."/".$temp3;
33
+ $filepath3 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp3,'SJIS-win','UTF-8');
34
- $filepath4 = "/".$username."/".$temp4;
34
+ $filepath4 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp4,'SJIS-win','UTF-8');
35
- $filepath5 = "/".$username."/".$temp5;
35
+ $filepath5 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp5,'SJIS-win','UTF-8');
36
- $filepath6 = "/".$username."/".$temp6;
36
+ $filepath6 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp6,'SJIS-win','UTF-8');
37
37
 
38
38
  $array = [$filepath1,$filepath2,$filepath3,$filepath4,$filepath5,$filepath6];
39
39
 

1

ソース編集

2018/03/27 05:27

投稿

cofee
cofee

スコア44

title CHANGED
File without changes
body CHANGED
@@ -37,7 +37,7 @@
37
37
 
38
38
  $array = [$filepath1,$filepath2,$filepath3,$filepath4,$filepath5,$filepath6];
39
39
 
40
- $this->sendMailTo_w($filepath1);
40
+ $this->sendMailTo_w($array);
41
41
 
42
42
  return view('admin::mail_index');
43
43
  }
@@ -86,18 +86,16 @@
86
86
  if ($email['bcc']) {
87
87
  $message->bcc($email['bcc']);
88
88
  }
89
+
89
- //
90
+ if (array_key_exists('attach', $email)) {
90
- // if(is_array($email['attach'])){
91
+ if (is_array($email['attach'])) {
91
- // $toArray = $email['attach'];
92
+ foreach ($email['attach'] as $file) {
92
- // }else{
93
- // $toArray = $email['attach'];
94
- // }
95
- // foreach($toArray as $key => $value){
96
- // $message->attach($value);
93
+ $message->attach($file);
94
+ }
95
+ }
97
- // }
96
+ else {
98
-
99
- if (array_key_exists('attach', $email) && $email['attach']) {
100
- $message->attach($email['attach']);
97
+ $message->attach($email['attach']);
98
+ }
101
99
  }
102
100
  });
103
101
  }