Subversion-Projekte lars-tiefland.content-management

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
1 lars 1
<?
2
	$_to="info@weban.de";
3
	$_from="test.info@weban.de";
4
	$_subject="Dies ist ein Test";
5
 
6
	$MSG[PLAIN]="dies ist ein test";
7
	$MSG[HTML]="<hr>Dies ist ein <a href=3D\"http://www.test.de\">TEST</a><hr>";
8
 
9
	/* INIT $boundary */
10
	srand ((double)microtime()*1000000);
11
	$boundary="";
12
	for ($a=0; $a <= 15; $a++)
13
	{
14
		$boundary=$boundary.sprintf("%02X",rand(0,255));
15
	}
16
	$boundary="=_".$boundary;
17
 
18
	$MIME_HEADERS["From"]			=	"From: $_from";
19
	$MIME_HEADERS["MIME-Version"]	=	"MIME-Version: 1.0";
20
	$MIME_HEADERS["Content-Type"]	=	"Content-Type: multipart/alternative;";
21
	$MIME_HEADERS["boundary"]		=	chr(9)."boundary=\"".$boundary."\"";
22
 
23
	$CONTENT_HEADERS=array
24
	(
25
		"PLAIN" => array(
26
			"--".$boundary,
27
			"Content-Type: text/plain; charset=\"ISO-8859-1\"",
28
			"Content-Transfer-Encoding: 7bit",
29
			"",""
30
			),
31
		"HTML" => array(
32
			"",
33
			"--".$boundary,
34
			"Content-Type: text/html; charset=\"ISO-8859-1\"",
35
			"Content-Transfer-Encoding: quoted-printable",
36
			"",""
37
			)
38
	);
39
 
40
	foreach(array_keys($CONTENT_HEADERS) as $elem)
41
	{
42
		$MSG[$elem]=join($CONTENT_HEADERS[$elem],"\n").$MSG[$elem];
43
	}
44
 
45
	mail
46
	(
47
		$_to,
48
		$_subject,
49
		join($MSG,"\n")."\n--".$boundary."--\n",
50
		join($MIME_HEADERS,"\n")
51
	);
52
?>