- foreach($this->contactData as $contact) {
- $emailtype = true;
- $this->SetLang($contact['lang']);
- include("includes/doctext.inc");
-
- require_once($path_to_root . "/reporting/includes/class.mail.inc");
- $mail = new email(str_replace(",", "", $this->company['coy_name']), $this->company['email']);
- $mail->charset = $this->encoding;
- if (!isset($contact['email']) || $contact['email'] == '')
- $contact['email'] = isset($myrow['contact_email']) ? $myrow['contact_email'] : '';
-
- $to = str_replace(",", "", $contact['name'].' '.$contact['name2'])." <" . $contact['email'] . ">";
- $msg = $doc_Dear_Sirs . " " . $myrow['DebtorName'] . ",\n\n" . $doc_AttachedFile . " " . $subject .
- "\n\n";
- if (isset($myrow['dimension_id']) && $myrow['dimension_id'] > 0 && $doctype == ST_SALESINVOICE) // helper for payment links
- {
- if ($myrow['dimension_id'] == 1)
+ foreach($this->contactData as $contact) {
+ if (!isset($contact['email']))
+ continue;
+ $emailtype = true;
+ $this->SetLang($contact['lang']);
+ include("includes/doctext.inc");
+
+ require_once($path_to_root . "/reporting/includes/class.mail.inc");
+ $mail = new email(str_replace(",", "", $this->company['coy_name']),
+ $this->company['email']);
+ $mail->charset = $this->encoding;
+
+ $to = str_replace(",", "", $contact['name'].' '.$contact['name2'])
+ ." <" . $contact['email'] . ">";
+ $msg = $doc_Dear_Sirs . " " . $contact['name2'] . ",\n\n"
+ . $doc_AttachedFile . " " . $subject ."\n\n";
+ if (isset($myrow['dimension_id']) && $myrow['dimension_id'] > 0 && $doctype == ST_SALESINVOICE) // helper for payment links