mirror of
https://github.com/pocketbase/pocketbase.git
synced 2026-10-08 15:27:27 +02:00
added Cc and Bcc headers to the sendmail command
This commit is contained in:
1 parent
7b3f4d62b1
commit
b2ed234d74
2 files changed
+12
-2
No files matched your search
@@ -49,6 +49,14 @@ func (c *Sendmail) send(m *Message) error {
|
||||
headers.Set("Content-Type", "text/html; charset=UTF-8")
|
||||
headers.Set("To", strings.Join(toAddresses, ","))
|
||||
|
||||
if len(m.Cc) > 0 {
|
||||
headers.Set("Cc", strings.Join(addressesToStrings(m.Cc, false), ","))
|
||||
}
|
||||
|
||||
if len(m.Bcc) > 0 {
|
||||
headers.Set("Bcc", strings.Join(addressesToStrings(m.Bcc, false), ","))
|
||||
}
|
||||
|
||||
cmdPath, err := findSendmailPath()
|
||||
if err != nil {
|
||||
return err
|
||||
@@ -75,7 +83,7 @@ func (c *Sendmail) send(m *Message) error {
|
||||
}
|
||||
// ---
|
||||
|
||||
sendmail := exec.Command(cmdPath, strings.Join(toAddresses, ","))
|
||||
sendmail := exec.Command(cmdPath, "-i", "-t")
|
||||
sendmail.Stdin = &buffer
|
||||
|
||||
return sendmail.Run()
|
||||
|
||||
Reference in new issue
Block a user