Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
class tgImap {
var $conf;
var $sender;
var $cc;
function __construct( $conf) {
$this->conf = $conf;
$this->sender = $conf['imap']['sender'];
$this->cc = $conf['imap']['cc'];
}
function mail($to, $subject, $body) {
// Falls eine Zeile der Nachricht mehr als 70 Zeichen enthälten könnte,
// sollte wordwrap() benutzt werden (http://de.php.net/manual/de/function.mail.php)
$body = wordwrap($body, 70);
$header = 'From: '. $this->sender . "\n" .
'Reply-To: '. $this->sender . "\n" .
'Cc: ' . $this->cc . "\n" .
'X-Mailer: PHP/' . phpversion() . "\n" .
'MIME-Version: 1.0' . "\n" .
'Content-type: text/plain; charset=UTF-8' . "\n".
'Content-Transfer-Encoding: 8bit' . "\n";
// replace linebreaks on www.textgrid.de
$body = str_replace("\r\n", "\n", $body);
mail($to, $subject, $body, $header);
}
}
?>