回答編集履歴
7
追記
test
CHANGED
@@ -73,3 +73,15 @@
|
|
73
73
|
```
|
74
74
|
|
75
75
|
|
76
|
+
|
77
|
+
---
|
78
|
+
|
79
|
+
|
80
|
+
|
81
|
+
**なんか少し前に同じ質問がされてますが解決したのではないのでしょうか?
|
82
|
+
|
83
|
+
[ZIPを添付したメールを送信したいですが、ファイルが添付されていない。](https://teratail.com/questions/57116)**
|
84
|
+
|
85
|
+
|
86
|
+
|
87
|
+
|
6
誤字修正
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
質問が編集されてまったく別の
|
1
|
+
質問が編集されてまったく別の内容になってますが・・・・
|
2
2
|
|
3
3
|
「添付ファイルつきのメールの作り方」は解決したのでしょうか?
|
4
4
|
|
5
回答修正
test
CHANGED
@@ -1,8 +1,6 @@
|
|
1
1
|
質問が編集されてまったく別の無いようになってますが・・・・
|
2
2
|
|
3
|
-
添付ファイルつきのメール
|
3
|
+
「添付ファイルつきのメールの作り方」は解決したのでしょうか?
|
4
|
-
|
5
|
-
|
6
4
|
|
7
5
|
zipファイルの作成するときに発生している問題については、別の質問にされたほうがいいです。
|
8
6
|
|
4
修正:ヘディング箇所誤記修正
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
---
|
24
24
|
|
25
|
-
###
|
25
|
+
###編集前の質問に対する回答は以下
|
26
26
|
|
27
27
|
|
28
28
|
|
3
質問が変わったので回答にアドバイス追記
test
CHANGED
@@ -1,3 +1,31 @@
|
|
1
|
+
質問が編集されてまったく別の無いようになってますが・・・・
|
2
|
+
|
3
|
+
添付ファイルつきのメール送信はできたのでしょうか?
|
4
|
+
|
5
|
+
|
6
|
+
|
7
|
+
zipファイルの作成するときに発生している問題については、別の質問にされたほうがいいです。
|
8
|
+
|
9
|
+
|
10
|
+
|
11
|
+
> //Fatal error: Call to undefined method ZipArchive::setPassword() in /home/blotag/www/ryu/csv/send.php on line 53
|
12
|
+
|
13
|
+
> $zip->setPassword('symfoware');
|
14
|
+
|
15
|
+
|
16
|
+
|
17
|
+
英語読めませんか?
|
18
|
+
|
19
|
+
> 致命的エラー: /home/blotag/www/ryu/csv/send.php の53行目でZipArchive::setPassword()メソッドを呼び出していますがそのようなものは存在しません。
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
---
|
24
|
+
|
25
|
+
###ヘディングのテキスト編集前の質問に対する回答は以下
|
26
|
+
|
27
|
+
|
28
|
+
|
1
29
|
添付するファイルのPATHが```$filepath = "text.zip";```のようにカレントディレクトリからの相対PATHにになってますが指定の場所に存在するのでしょうか?
|
2
30
|
|
3
31
|
|
2
回答追記
test
CHANGED
@@ -22,7 +22,7 @@
|
|
22
22
|
|
23
23
|
|
24
24
|
|
25
|
-
以下部分も```filename=\"text.zip"```とfilenameを指定しているにもかかわらず```basename($filepath)```を連結しているのはなぜでしょうか?
|
25
|
+
以下部分も```filename=\"text.zip"```とfilenameを指定しているにもかかわらず```basename($filepath)```を連結しているのはなぜでしょうか? あと```$filetype```はtacsheavenさんご指摘のとおりです。
|
26
26
|
|
27
27
|
```PHP
|
28
28
|
|
@@ -40,8 +40,10 @@
|
|
40
40
|
|
41
41
|
```PHP
|
42
42
|
|
43
|
-
$message .= "Content-Type: " . mime_content_type($filet
|
43
|
+
$message .= "Content-Type: " . mime_content_type($filepath) . "; name=\"" . basename($filepath) . "\"\n";
|
44
44
|
|
45
45
|
$message .= "Content-Disposition: attachment; filename=\"" . basename($filepath) . "\"\n";
|
46
46
|
|
47
47
|
```
|
48
|
+
|
49
|
+
|
1
回答追加
test
CHANGED
@@ -18,8 +18,30 @@
|
|
18
18
|
|
19
19
|
$message .= chunk_split(base64_encode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . $filepath)))."\n";
|
20
20
|
|
21
|
+
```
|
21
22
|
|
22
23
|
|
23
24
|
|
25
|
+
以下部分も```filename=\"text.zip"```とfilenameを指定しているにもかかわらず```basename($filepath)```を連結しているのはなぜでしょうか?
|
26
|
+
|
27
|
+
```PHP
|
28
|
+
|
29
|
+
$message .= "Content-Type: " . mime_content_type($filetype) . "; name=\"text.zip" . basename($filepath) . "\"\n";
|
30
|
+
|
31
|
+
$message .= "Content-Disposition: attachment; filename=\"text.zip" . basename($filepath) . "\"\n";
|
24
32
|
|
25
33
|
```
|
34
|
+
|
35
|
+
|
36
|
+
|
37
|
+
以下でいいのでは?
|
38
|
+
|
39
|
+
|
40
|
+
|
41
|
+
```PHP
|
42
|
+
|
43
|
+
$message .= "Content-Type: " . mime_content_type($filetype) . "; name=\"" . basename($filepath) . "\"\n";
|
44
|
+
|
45
|
+
$message .= "Content-Disposition: attachment; filename=\"" . basename($filepath) . "\"\n";
|
46
|
+
|
47
|
+
```
|