$ret = 'Mail not sent - Customer not known'; return $ret; } } else { $ret = 'Mail not sent - Customer unknown'; return $ret; } } function sendResetPass($name, $email) { require_once 'athena_mail.php';
$sqltext = "SELECT customer.custid, customer.co_name, quotes.contactsid,quotes.quotesid,\ncontacts.fname, contacts.sname FROM customer,quotes,contacts \nWHERE quotes.custid=customer.custid AND quotesid=? LIMIT 1"; // print $sqltext; $q = $db->select($sqltext, array($_GET['id']), 'i'); if (!empty($q)) { $r = $q[0]; $custid = $r->custid; $quoteno = $r->quotesid; $email = getCustEmailAdd($custid); if (!isset($email) || $email == '') { $email = getCustEmailAdd($custid); } if (!isset($email) || $email == '') { echo "Mailer Error: Customer has No Email address on the system"; exit; } $docTitlePrefix = preg_replace('/\\W/', '_', $owner->co_name); $docTitlePrefix = preg_replace('/__/', '_', $docTitlePrefix); $docTitle = $docTitlePrefix . "_Quote_" . $quoteno . '.pdf'; $docName = $dataDir . "/pdf/quotes/{$docTitle}"; // Make PDF passthru("perl {$athenaDir}/lib/perl/bin/make_pdf_quote.pl format=file id=" . $_GET['id']); $name = $r->fname . ' ' . $r->sname; $esubject = "Your Quote from " . $owner->co_name; $ret = sendAthenaEmail($name, $email, $esubject, $htmlBody, $docName, $docTitle); $logContent = "QuoteID: " . $_GET['id'] . " sent to {$name} - {$email}"; $logresult = logEvent(2, $logContent); } else { $ret = 'There was a problem ... '; } echo $ret; include "../tmpl/blank_footer.php";