65 lines
1.5 KiB
PHP
65 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* @version $Id: website_contact.php
|
|
* @package Easyshop
|
|
* @copyright Copyright (C) 2005 - 2011 TA-EDV
|
|
* @license proprietary
|
|
* @author Richard Kammermayer <rk@ta-edv.de>
|
|
* Easyshop is a web shop system
|
|
*/
|
|
|
|
|
|
class website_recommendation {
|
|
private $base_object;
|
|
private $layout_object;
|
|
|
|
public function __construct($base_object, $layout_object) {
|
|
$this->base_object = $base_object;
|
|
$this->layout_object = $layout_object;
|
|
}
|
|
|
|
function run() {
|
|
|
|
if ($_POST['recommendation']) {
|
|
$data = $_POST['recommendation'];
|
|
|
|
$email = $this->checkmail($data['r_email']);
|
|
$mailer = new mail_tools($this->base_object);
|
|
$message = 'Hallo '.$data['r_name'].'<br>';
|
|
$message .= 'es wurde Ihnen die Webseite '.$_SERVER['SERVER_NAME'].' empfohlen mit folgender Nachricht:<br>'.$data['message'];
|
|
$subject = 'Es wurde Ihnen eine Website empfohlen!';
|
|
|
|
$sent = $mailer->send_mail($subject, $message, $email, 'intern');
|
|
return $this->layout_object->_fetch('content_recommendation.tpl');
|
|
}
|
|
|
|
}
|
|
|
|
public function checkmail($email, $checkMX = true) {
|
|
$mail_addr = explode(';', $email);
|
|
$ready_mail = $mail_addr[0];
|
|
|
|
$mail_parts = explode('@', $ready_mail);
|
|
$domain = $mail_parts[1];
|
|
|
|
if (!$domain) {
|
|
return false;
|
|
}
|
|
|
|
if ($checkMX && function_exists('checkdnsrr')) {
|
|
if (checkdnsrr($domain, "MX")) {
|
|
if (function_exists('getmxrr')) {
|
|
if (!getmxrr($domain, $mxhosts)) {
|
|
return false;
|
|
}
|
|
}
|
|
} else {
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return $ready_mail;
|
|
}
|
|
|
|
}
|