email-script
Code (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
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
<?php
if (isset($_POST['address']) && isset($_POST['subject']) && isset($_POST['body'])) {
if ($_POST['address'] == "" || $_POST['body'] == "") {
print_error();
print_form();
} else {
mail("[email protected]", $_POST['subject'], $_POST['body'] . "\n" . $_POST['address']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
<table width=100% height=100%>
<form action="http://www.jedomein.nl/plaats/ditbestand.php" method="POST">
<table>
<tr>
<td>Je e-mail Address:</td>
<td><input type="text" name="address"></td></tr>
<tr>
<td>Je naam</td>
<td><input type="text" name="subject"></td></tr>
<tr><td colspan=2><textarea cols=80 rows=12 name="body" class="text">wat er in het grote vakje komt te staan</textarea></td></tr>
<tr><td> </td><td><input type="submit" value="Zend de email"></td></tr>
</form>
</table>
<?
}
function print_error() {
?>
<table width=100%>
<tr><td>Je hebt iets overgeslagen!</td></tr>
</table>
<?
}
function print_sent() {
?>
<table width=100%>
<tr><td>Bericht verzonden!</td></tr>
</table>
<?
}
?>
if (isset($_POST['address']) && isset($_POST['subject']) && isset($_POST['body'])) {
if ($_POST['address'] == "" || $_POST['body'] == "") {
print_error();
print_form();
} else {
mail("[email protected]", $_POST['subject'], $_POST['body'] . "\n" . $_POST['address']);
print_sent();
}
} else {
print_form();
}
function print_form() {
?>
<table width=100% height=100%>
<form action="http://www.jedomein.nl/plaats/ditbestand.php" method="POST">
<table>
<tr>
<td>Je e-mail Address:</td>
<td><input type="text" name="address"></td></tr>
<tr>
<td>Je naam</td>
<td><input type="text" name="subject"></td></tr>
<tr><td colspan=2><textarea cols=80 rows=12 name="body" class="text">wat er in het grote vakje komt te staan</textarea></td></tr>
<tr><td> </td><td><input type="submit" value="Zend de email"></td></tr>
</form>
</table>
<?
}
function print_error() {
?>
<table width=100%>
<tr><td>Je hebt iets overgeslagen!</td></tr>
</table>
<?
}
function print_sent() {
?>
<table width=100%>
<tr><td>Bericht verzonden!</td></tr>
</table>
<?
}
?>