1
0
www.mikescher.com/www/protected/models/SendMailForm.php

59 lines
1.1 KiB
PHP
Raw Normal View History

2014-05-14 14:14:45 +02:00
<?php
class SendMailForm extends CFormModel {
public $name;
public $email;
public $header;
public $message;
public function rules()
{
return array(
array('name, email, header, message', 'required'),
array('name', 'length', 'min'=>3, 'max'=>128),
array('email', 'length', 'min'=>5, 'max'=>128),
array('header', 'length', 'min'=>0, 'max'=>200),
array('message', 'length', 'min'=>1, 'max'=>20000),
);
}
public function send() {
$Software = getenv("SERVER_SOFTWARE");
$ip = getenv("REMOTE_ADDR");
$date = date('Y-m-d G:i:s');
$Browser = $_SERVER['HTTP_USER_AGENT'];
$empfaenger = "kundenservice@mikescher.de";
2016-01-01 21:05:35 +01:00
$betreff = "Neue Mail für Mikescher.com vom Typ Kontaktformular ($this->header)";
2014-05-14 14:14:45 +02:00
$text =
"
Name: $this->name
Typ : Kontaktformular
IP: $ip
Datum: $date
E-Mail: $this->email
Software: $Software
Browser: $Browser
Header: $this->header
Text: $this->message
";
if (! (empty($name) && empty($textin) && empty($typ) && empty($link) && empty($email)) )
{
return mail($empfaenger, $betreff, $text,"From: Mikescher <spamcatcher@mikescher.de>");
}
else
{
return false;
}
}
}