queryFromFile (__DIR__.'/contact', $_REQUEST); //$customerId = $db->getValue ('SELECT @id'); $conf = $db->getRow ( 'SELECT m.host, m.port, m.secure, m.sender, m.user, m.password, c.recipient FROM mail_config m JOIN contact c' ); $mail = new PHPMailer (); $mail->isSMTP (); $mail->Host = $conf['host']; if (!empty ($conf['user'])) { $mail->SMTPAuth = TRUE; $mail->Username = $conf['user']; $mail->Password = base64_decode ($conf['password']); } else $mail->SMTPAuth = FALSE; if ($conf['secure']) { $mail->SMTPSecure = 'ssl'; $mail->Port = 465; } $mail->setFrom ($conf['sender'], 'Web'); $mail->addAddress ($conf['recipient']); $mail->isHTML (TRUE); $mail->Subject = s('New customer request'); $mail->Body = '
'. print_r ($_REQUEST, TRUE) .''; if (!$mail->send ()) throw new Exception ($mail->ErrorInfo); return TRUE; } }