Ik ben bezig met het maken van een html mail die vanuit een script aangestuurd wordt...
nu verstuurt ie alles netjes enzo, maar hij wordt niet visueel weergegeven.
dit deel verzendt het...
dit deel genereert de html...
dat werkt prima, dus zou het aan de headers liggen ? die ik direct van php.net heb gehaald...
of aan het feit dat er css opmaak in zit of iets dergelijks?
ik zou het graag horen!
nu verstuurt ie alles netjes enzo, maar hij wordt niet visueel weergegeven.
PHP:
1
2
3
4
5
6
7
8
| $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'To: ' . $option['bedrijf'] . ' <' . $option['email'] . '>' . "\r\n"; $headers .= 'From: ' . $naam . ' <' . $_POST['email'] . '>' . "\r\n"; if(mail($to, "Sollicitatie van: " . $naam, $message, $headers)) { echo "<h4>Je sollicitatie is verstuurd!</h4>\n"; } |
dit deel verzendt het...
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
| function message_build($input, $naam, $email, $tel, $adres, $postcode, $woonplaats) { $output .= "<html>\n"; $output .= "<head>\n"; $output .= "<title>Sollicitatie: " . $naam . "</title>\n"; $output .= "<style type=\"text/css\">\n"; $output .= "body {\n"; $output .= "margin: 10 20 10 20;\n"; $output .= "padding: 0 0 0 0;\n"; $output .= "font-size: 11px;\n"; $output .= "font-family: tahoma, verdana;\n"; $output .= "}\n"; $output .= "h2 {\n"; $output .= "font-size: 14px;\n"; $output .= "font-weight: bold;\n"; $output .= "color: #0f466d;\n"; $output .= "border-bottom: 1px solid #000000;\n"; $output .= "padding-bottom: 3px;\n"; $output .= "margin: 0 0 0 0;\n"; $output .= "}\n"; $output .= "p.lijst {\n"; $output .= "color: #0f466d;\n"; $output .= "font-size: 12px;\n"; $output .= "padding: 15px;\n"; $output .= "margin: 6px 0 0 0;\n"; $output .= "}\n"; $output .= "p.lijst i {\n"; $output .= "color: #187cb0;\n"; $output .= "}\n"; $output .= "p.contact {\n"; $output .= "font-size: 11px;\n"; $output .= "color: #187cb0;\n"; $output .= "padding-top: 3px;\n"; $output .= "border-top: 1px solid #000000;\n"; $output .= "}\n"; $output .= "a:link, a:active, a:visited {\n"; $output .= "color: #187cb0;\n"; $output .= "text-decoration: underline;\n"; $output .= "}\n"; $output .= "a:hover {\n"; $output .= "color: #187cb0;\n"; $output .= "text-decoration: none;\n"; $output .= "}\n"; $output .= "</style>\n"; $output .= "</head>\n"; $output .= "<body>\n"; $output .= "<h2>" . $naam . "</h2>\n"; $output .= "<p class=\"lijst\">\n"; $output .= $input; $output .= "</p>\n"; $output .= "<p class=\"contact\">\n"; $output .= "<a href=\"mailto:" . $email . "\">" . $email . "</a><br />\n"; $output .= "tel. " . $tel . "<br />\n"; $output .= $adres . "<br />\n"; $output .= $postcode . ", " . $woonplaats . "\n"; $output .= "</p>\n"; $output .= "</body>\n"; $output .= "</html>\n"; return $output; } |
dit deel genereert de html...
dat werkt prima, dus zou het aan de headers liggen ? die ik direct van php.net heb gehaald...
of aan het feit dat er css opmaak in zit of iets dergelijks?
ik zou het graag horen!