質問編集履歴

2

メール設定について追記

2017/09/24 14:53

投稿

phpuser
phpuser

スコア15

test CHANGED
File without changes
test CHANGED
@@ -17,3 +17,107 @@
17
17
  /var/log/maillogは空っぽでした。
18
18
 
19
19
  Gmailから受信したメールのソースを見たら、Received: from xxx.localdev ([202.214.xxx.xxx])のようなDockerに設定しているドメインになっていました。
20
+
21
+
22
+
23
+ (9/24 追記)
24
+
25
+ メールの設定
26
+
27
+ ```php
28
+
29
+ 'EmailTransport' => [
30
+
31
+ 'default' => [
32
+
33
+ 'className' => 'Mail',
34
+
35
+ // The following keys are used in SMTP transports
36
+
37
+ 'host' => 'localhost',
38
+
39
+ 'port' => 25,
40
+
41
+ 'timeout' => 30,
42
+
43
+ 'username' => 'user',
44
+
45
+ 'password' => 'secret',
46
+
47
+ 'client' => null,
48
+
49
+ 'tls' => null,
50
+
51
+ 'url' => env('EMAIL_TRANSPORT_DEFAULT_URL', null),
52
+
53
+ ],
54
+
55
+ ],
56
+
57
+
58
+
59
+ /**
60
+
61
+ * Email delivery profiles
62
+
63
+ *
64
+
65
+ * Delivery profiles allow you to predefine various properties about email
66
+
67
+ * messages from your application and give the settings a name. This saves
68
+
69
+ * duplication across your application and makes maintenance and development
70
+
71
+ * easier. Each profile accepts a number of keys. See `Cake\Mailer\Email`
72
+
73
+ * for more information.
74
+
75
+ */
76
+
77
+ 'Email' => [
78
+
79
+ 'default' => [
80
+
81
+ 'transport' => 'default',
82
+
83
+ 'to' => 'to@example.com',
84
+
85
+ 'from' => 'from@gmail.com',
86
+
87
+ 'returnPath' => 'from@gmail.com'
88
+
89
+ //'charset' => 'utf-8',
90
+
91
+ //'headerCharset' => 'utf-8',
92
+
93
+ ],
94
+
95
+ ],
96
+
97
+ ```
98
+
99
+
100
+
101
+ メール送信のメソッド
102
+
103
+ ```php
104
+
105
+ public function register($member)
106
+
107
+ {
108
+
109
+ $this
110
+
111
+ ->setTo($member->email, $member->name)
112
+
113
+ ->setSubject('subject)
114
+
115
+ ->setEmailFormat('text')
116
+
117
+ ->setViewVars(['member' => $member])
118
+
119
+ ->setTemplate('register');
120
+
121
+ }
122
+
123
+ ```

1

追記しました。

2017/09/24 14:53

投稿

phpuser
phpuser

スコア15

test CHANGED
File without changes
test CHANGED
@@ -5,3 +5,15 @@
5
5
  特に、夜は届くけれど日中は届かないような感覚があります。
6
6
 
7
7
  こういうことはあるのでしょうか。
8
+
9
+
10
+
11
+ (追記)
12
+
13
+ 届かない場合もエラーにはなっていません。
14
+
15
+ fromはGmailのアドレスで、toはGoogle Appsのアドレスです。
16
+
17
+ /var/log/maillogは空っぽでした。
18
+
19
+ Gmailから受信したメールのソースを見たら、Received: from xxx.localdev ([202.214.xxx.xxx])のようなDockerに設定しているドメインになっていました。