- // 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";
- }
- $this->header .= "MIME-Version: 1.0\n";
- $this->header .= "Content-Type: multipart/mixed; boundary=$this->boundary\n\n";
- $this->header .= "This is a multi-part message in MIME format\n";
- $this->header .= "--$this->boundary\n";
- $this->header .= $this->body;
-
- // Attachment hinzufügen
- $max = count($this->attachment);
- if ($max > 0)
+ // 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" ;
+ $this->header .= "Content-Type: multipart/mixed;\n boundary=\"$this->boundary\"\n";
+
+ // Add Attachments
+ if (!empty($this->attachment))