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

回答編集履歴

2

削除された内容の復元を行いました

2020/12/01 04:38

投稿

tomato879241
tomato879241

スコア133

answer CHANGED
@@ -1,1 +1,11 @@
1
+ 添付ファイルがない場合の部分に以下のものを挿入することで解決しました。
2
+ ```PHP
3
+ // boundary
4
+ $semi_rand = md5(time());
5
+ $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
1
- xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx
6
+ // headers for attachment
7
+ $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
8
+ // multipart boundary
9
+ $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html;\n" . "Content-Transfer-Encoding: 7bit\n\n" . $htmlMessage . "\n\n";
10
+ $message .= "--{$mime_boundary}\n";
11
+ ```

1

xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx

2020/12/01 04:37

投稿

退会済みユーザー
answer CHANGED
@@ -1,14 +1,1 @@
1
- 添付ファイルがない場合の部分に以下のものを挿入することで解決しました。
2
-
3
- ```PHP
4
- // boundary
5
- $semi_rand = md5(time());
6
- $mime_boundary = "==Multipart_Boundary_x{$semi_rand}x";
7
-
8
- // headers for attachment
1
+ xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx xxxxx
9
- $headers .= "\nMIME-Version: 1.0\n" . "Content-Type: multipart/mixed;\n" . " boundary=\"{$mime_boundary}\"";
10
-
11
- // multipart boundary
12
- $message = "This is a multi-part message in MIME format.\n\n" . "--{$mime_boundary}\n" . "Content-Type: text/html;\n" . "Content-Transfer-Encoding: 7bit\n\n" . $htmlMessage . "\n\n";
13
- $message .= "--{$mime_boundary}\n";
14
- ```