回答編集履歴
1
追記
test
CHANGED
@@ -21,3 +21,69 @@
|
|
21
21
|
```
|
22
22
|
|
23
23
|
参考[sendEmail(Object)](https://developers.google.com/apps-script/reference/mail/mail-app#sendEmail(Object))
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
追記02/11 21:00
|
28
|
+
|
29
|
+
---
|
30
|
+
|
31
|
+
|
32
|
+
|
33
|
+
```GoogleAppScript
|
34
|
+
|
35
|
+
// 送信先オプション
|
36
|
+
|
37
|
+
var options = {};
|
38
|
+
|
39
|
+
if ( bcc ) options.bcc = bcc;
|
40
|
+
|
41
|
+
if ( reply ) options.replyTo = reply;
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
}
|
46
|
+
|
47
|
+
// メール送信
|
48
|
+
|
49
|
+
if ( to ) {
|
50
|
+
|
51
|
+
MailApp.sendEmail(to, cc , subject, body, options);
|
52
|
+
|
53
|
+
}else
|
54
|
+
|
55
|
+
MailApp.sendEmail(admin, "【失敗】Googleフォームにメールアドレスが指定されていません", body);
|
56
|
+
|
57
|
+
```
|
58
|
+
|
59
|
+
↑この部分を次のように書き換えれば上手くいくと思ったのですがどうでしょうか?
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
```GoogleAppScript
|
64
|
+
|
65
|
+
// メール送信
|
66
|
+
|
67
|
+
if ( to ) {
|
68
|
+
|
69
|
+
MailApp.sendEmail({
|
70
|
+
|
71
|
+
to: to,
|
72
|
+
|
73
|
+
cc: cc,
|
74
|
+
|
75
|
+
bcc: bcc,
|
76
|
+
|
77
|
+
replyTo: reply,
|
78
|
+
|
79
|
+
subject: subject,
|
80
|
+
|
81
|
+
body: body
|
82
|
+
|
83
|
+
});
|
84
|
+
|
85
|
+
}else
|
86
|
+
|
87
|
+
MailApp.sendEmail(admin, "【失敗】Googleフォームにメールアドレスが指定されていません", body);
|
88
|
+
|
89
|
+
```
|