- // CC Empfänger hinzufügen
- $max = count($this->cc);
- if ($max > 0)
- {
- $this->header .= "Cc: ".$this->cc[0];
- for ($i = 1; $i < $max; $i++)
- {
- $this->header .= ", ".$this->cc[$i];
- }
- $this->header .= "\n";
- }
- // BCC Empfänger hinzufügen
- $max = count($this->bcc);
- if ($max > 0)
- {
- $this->header .= "Bcc: ".$this->bcc[0];
- for ($i = 1; $i < $max; $i++)
- {
- $this->header .= ", ".$this->bcc[$i];
- }
- $this->header .= "\n";
- }
+ // Add CC Recipients
+ if (!empty($this->cc))
+ $this->header .= "Cc: " . implode(", ", $this->cc) . "\n" ;
+
+ // Add BCC Recipients
+ if (!empty($this->bcc))
+ $this->header .= "Bcc: " . implode(", ", $this->bcc) . "\n" ;