mirror of
https://gitlab.com/siarp/beethoven2000.de.git
synced 2026-08-07 19:18:18 +00:00
fix contact email encoding
This commit is contained in:
@@ -7,7 +7,7 @@ class Contact_Mail extends Message {
|
||||
|
||||
private $to = 'Martin Stadler <martin@siarp.de>, Tilman Walther <tilman@tilman.de>';
|
||||
private $subject = 'Post für Beethoven2000';
|
||||
private $from = 'From: Beethoven2000 Kontaktformular <abi@beethoven2000.de>';
|
||||
private $from = 'Beethoven2000 Kontaktformular <abi@beethoven2000.de>';
|
||||
|
||||
/**
|
||||
* Sendet die Mail mit den Übergebenen Parametern.
|
||||
@@ -25,16 +25,24 @@ class Contact_Mail extends Message {
|
||||
$this->spam = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
$header = 'MIME-Version: 1.0' . "\r\n";
|
||||
$header .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
|
||||
$header .= 'From: ' . $this->from . "\r\n";
|
||||
|
||||
$contents = 'Name: ' . $name . "\n";
|
||||
$contents .= 'eMail: ' . $address . "\n";
|
||||
$contents .= "\n--------\n";
|
||||
$contents .= utf8_decode(preg_replace('~\r~', '', $message));
|
||||
$contents = 'Name: ' . $name . "\r\n";
|
||||
$contents .= 'eMail: ' . $address . "\r\n";
|
||||
$contents .= "\r\n--------\r\n";
|
||||
$contents .= $message;
|
||||
|
||||
if (!mail($this->to, $this->subject, $contents, $this->from)) {
|
||||
if (!mail($this->to, $this->encode($this->subject), $contents, $header)) {
|
||||
$this->error = true;
|
||||
}
|
||||
}
|
||||
|
||||
private function encode ($text) {
|
||||
return '=?UTF-8?B?' . base64_encode($text) . '?=';
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
Reference in New Issue
Block a user