Ik krijg het niet voorelkaar en snap niet waar het aan kan liggen, maar de PHP functie mail verzend geen HTML meer.
Als email resultaat krijg ik dit:
Content-Type: multipart/alternative; boundary = HTMLDEMO3fb0e1a865bb9 This is a MIME encoded message. --HTMLDEMO3fb0e1a865bb9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: base64 VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCB2ZXJzaW9uIQ== --HTMLDEMO3fb0e1a865bb9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: base64 VGhpcyB0aGUgPGI+SFRNTDwvYj4gdmVyc2lvbiE=
<P>Hallo dit is een test<BR>Test<P>
Op de een of andere manier lijkt PHP de HTML mail niet correct te verwerken, wellicht dat er een instelling gewijzigd moet worden in php.ini ? Maar welke, wie kan mij helpen?
PHP:
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
| //add From: header $headers = "From: webserver@localhost\r\n"; //specify MIME version 1.0 $headers .= "MIME-Version: 1.0\r\n"; //unique boundary $boundary = uniqid("HTMLDEMO"); //tell e-mail client this e-mail contains//alternate versions $headers .= "Content-Type: multipart/alternative" . "; boundary = $boundary\r\n\r\n"; //message to people with clients who don't //understand MIME $headers .= "This is a MIME encoded message.\r\n\r\n"; //plain text version of message $headers .= "--$boundary\r\n" . "Content-Type: text/plain; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode("This is the plain text version!")); //HTML version of message $headers .= "--$boundary\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n" . "Content-Transfer-Encoding: base64\r\n\r\n"; $headers .= chunk_split(base64_encode("This the <b>HTML</b> version!")); //send message mail($mymail, "An HTML Message", "<P>Hallo dit is een test<BR>Test<P>", $headers); |
Als email resultaat krijg ik dit:
Content-Type: multipart/alternative; boundary = HTMLDEMO3fb0e1a865bb9 This is a MIME encoded message. --HTMLDEMO3fb0e1a865bb9 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: base64 VGhpcyBpcyB0aGUgcGxhaW4gdGV4dCB2ZXJzaW9uIQ== --HTMLDEMO3fb0e1a865bb9 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: base64 VGhpcyB0aGUgPGI+SFRNTDwvYj4gdmVyc2lvbiE=
<P>Hallo dit is een test<BR>Test<P>
Op de een of andere manier lijkt PHP de HTML mail niet correct te verwerken, wellicht dat er een instelling gewijzigd moet worden in php.ini ? Maar welke, wie kan mij helpen?