質問編集履歴

3

画像追加

2018/03/27 05:30

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -201,3 +201,11 @@
201
201
  }
202
202
 
203
203
  ```
204
+
205
+
206
+
207
+ 複数送信できたのですが、ファイル名が文字化けしてしまいます。
208
+
209
+
210
+
211
+ ![文字化け](5f3adf294e439c9dc4492879e7f21b12.jpeg)

2

ソース修正

2018/03/27 05:30

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -58,17 +58,17 @@
58
58
 
59
59
 
60
60
 
61
- $filepath1 = "/".$username."/".$temp1;
61
+ $filepath1 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp1,'SJIS-win','UTF-8');
62
-
62
+
63
- $filepath2 = "/".$username."/".$temp2;
63
+ $filepath2 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp2,'SJIS-win','UTF-8');
64
-
64
+
65
- $filepath3 = "/".$username."/".$temp3;
65
+ $filepath3 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp3,'SJIS-win','UTF-8');
66
-
66
+
67
- $filepath4 = "/".$username."/".$temp4;
67
+ $filepath4 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp4,'SJIS-win','UTF-8');
68
-
68
+
69
- $filepath5 = "/".$username."/".$temp5;
69
+ $filepath5 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp5,'SJIS-win','UTF-8');
70
-
70
+
71
- $filepath6 = "/".$username."/".$temp6;
71
+ $filepath6 = '/'.mb_convert_encoding($username,'SJIS-win','UTF-8').'/'.mb_convert_encoding($temp6,'SJIS-win','UTF-8');
72
72
 
73
73
 
74
74
 

1

ソース編集

2018/03/27 05:27

投稿

cofee
cofee

スコア44

test CHANGED
File without changes
test CHANGED
@@ -76,7 +76,7 @@
76
76
 
77
77
 
78
78
 
79
- $this->sendMailTo_w($filepath1);
79
+ $this->sendMailTo_w($array);
80
80
 
81
81
 
82
82
 
@@ -174,29 +174,25 @@
174
174
 
175
175
  }
176
176
 
177
+
178
+
177
- //
179
+ if (array_key_exists('attach', $email)) {
178
-
180
+
179
- // if(is_array($email['attach'])){
181
+ if (is_array($email['attach'])) {
180
-
182
+
181
- // $toArray = $email['attach'];
183
+ foreach ($email['attach'] as $file) {
182
-
183
- // }else{
184
+
184
-
185
- // $toArray = $email['attach'];
186
-
187
- // }
188
-
189
- // foreach($toArray as $key => $value){
190
-
191
- // $message->attach($value);
185
+ $message->attach($file);
186
+
192
-
187
+ }
188
+
189
+ }
190
+
193
- // }
191
+ else {
194
-
195
-
196
-
197
- if (array_key_exists('attach', $email) && $email['attach']) {
192
+
198
-
199
- $message->attach($email['attach']);
193
+ $message->attach($email['attach']);
194
+
195
+ }
200
196
 
201
197
  }
202
198