hallo
habe eine HTML form mit pull-down-menu gemacht.
jedem land ist eine andere mail adresse zugeordnet.
wenn man in pull-down-menu ein land auswählt sollte eine mail an die entsprechende adresse geschickt werden.
die scheint aber in meinem fall nicht zu klappen:
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
<html>
<head>
</head>
<body bgcolor="#FFFFFF" text="#003399" link="#0000FF" vlink="#800000" alink="#FF0033">
<form action="/cgi-bin/mail.pl" method="POST">
<center>
<table border="0" cellspacing="2" cellpadding="2" align="center" width="500">
<tr>
<td valign="middle" align="right"><b>
<font face="ARIAL CE, ARIAL, HELVETICA , GENEVA" size="2" color="#008080">
Ihre E-mail:</font></b></td>
<td valign="middle"><input type="Text" name="email" size="30"></td>
</tr>
<tr>
<td valign="middle" align="right"><b>
<font face="ARIAL CE, ARIAL, HELVETICA , GENEVA" size="2" color="#008080">
Destination:</font></b></td>
<td valign="middle"><select name="Destination" class="Auswahl">
<option></option>
<option>France</option>
<option>Germany</option>
</select></td>
</tr>
<tr>
<td valign="middle" align="right"><b>
<font face="ARIAL CE, ARIAL, HELVETICA , GENEVA" size="2" color="#008080">
Ihr Name:</font></b></td>
<td valign="middle"><input type="Text" name="yourname" size="30"></td>
</tr>
<tr>
<td valign="top" align="right"><b>
<font face="ARIAL CE, ARIAL, HELVETICA , GENEVA" size="2" color="#008080">
Ihre Nachricht:</font></b></td>
<td valign="top"><textarea name="message" cols="28" rows="6"></textarea></td>
</tr>
<tr>
<td colspan="2" align="center">
<pre>
<input type="Submit" value="Senden"> <input type="reset" value="Clear">
</pre>
</td>
</tr>
</table>
</form>
</body>
</html>
und dazu ein perl geschrieben:
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
#!/usr/bin/perl -w
use CGI ':standard';
use CGI::Carp qw(fatalsToBrowser);
$mailprog = '/usr/sbin/sendmail -t';
$email = 'zzz@hotmail.com';
%mail_address = ("France" => 'xxx@hotmail.com',
"Germany" => 'yyy@hotmail.com');
$mail_destination = $mail_address{$FORM{'Destination'}};
print "Content-type:text/html\n\n";
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
@pairs = split(/&/, $buffer);
foreach $pair (@pairs)
{
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/~!/ ~!/g;
$Form[$i] = $name;
$i = $i + 1;
$Form[$i] = $value;
$i = $i + 1;
$FORM{$name} = $value;
}
$email = $FORM{'email'};
$Destination = $FORM{'Destination'};
$yourname = $FORM{'yourname'};
$message = $FORM{'message'};
open (MAIL, "|$mailprog") || "Can't open $mailprog!\n";
print (MAIL "From: $email\n");
print (MAIL "To: $mail_destination\n");
for ($i=0; $i<=$#Form; $i=$i+2)
{
print MAIL "$Form[$i]\: $Form[$i+1]\n";
}
close (MAIL);
weiss jemand vielleicht wo der hund begraben liegt ?