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

質問編集履歴

2

修正

2019/08/30 06:06

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -21,14 +21,9 @@
21
21
  $emailbody = <<<EOF
22
22
  EOF;
23
23
  $email = new Email('default');
24
+ $email->attachments($data['file']);
24
25
  $email->to($data['email']);
25
- ->send($emailbody)
26
+ ->send($emailbody);
26
- ->attachments([
27
- '添付ファイル' => [
28
- 'file' => $data['file'],
29
- 'mimetype' => $data['file']['type']
30
- ]
31
- ]);
32
27
  }
33
28
  ```
34
29
 
@@ -42,6 +37,6 @@
42
37
  ]
43
38
 
44
39
  $email->attachmentsでうまく添付ファイルの送信ができませんでした。
45
- Call to a member function attachments() on array というエラーが出ます。
40
+ File not found: "0" というエラーが出ます。
46
41
  Controller側でどのような処理が必要でしょうか?
47
42
  ご教示いただけると幸いです。

1

詳細な情報の追加

2019/08/30 06:05

投稿

退会済みユーザー
title CHANGED
File without changes
body CHANGED
@@ -22,8 +22,13 @@
22
22
  EOF;
23
23
  $email = new Email('default');
24
24
  $email->to($data['email']);
25
- ->send($emailbody);
25
+ ->send($emailbody)
26
-
26
+ ->attachments([
27
+ '添付ファイル' => [
28
+ 'file' => $data['file'],
29
+ 'mimetype' => $data['file']['type']
30
+ ]
31
+ ]);
27
32
  }
28
33
  ```
29
34
 
@@ -37,5 +42,6 @@
37
42
  ]
38
43
 
39
44
  $email->attachmentsでうまく添付ファイルの送信ができませんでした。
45
+ Call to a member function attachments() on array というエラーが出ます。
40
46
  Controller側でどのような処理が必要でしょうか?
41
47
  ご教示いただけると幸いです。