|< 1 2 >| | 14 Einträge, 2 Seiten |
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
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $mailprog = '/usr/sbin/sendmail -t';
my $email = 'zzz@hotmail.com';
my %mail_address = ("France" => 'xxx@hotmail.com',
"Germany" => 'yyy@hotmail.com');
my $cgi = CGI-new;
print $cgi-header;
my %FORM = $cgi-Vars;
my $mail_destination = $mail_address{$FORM{'Destination'}};
$email = $FORM{'email'};
my $Destination = $FORM{'Destination'};
my $yourname = $FORM{'yourname'};
my $message = $FORM{'message'};
open (MAIL, "| $mailprog") || print "Can't open $mailprog!\n";
print (MAIL "From: $email\n");
print (MAIL "To: $mail_destination\n\n");
while (($key,$value) = each %FORM){
print MAIL "$key\: $value\n";
}
close MAIL;
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
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $mailprog = '/usr/sbin/sendmail -t';
my $email = 'zzz@hotmail.com';
my %mail_address = ("France" => 'xxx@hotmail.com',
"Germany" => 'yyy@hotmail.com');
my $cgi = CGI->new();
print $cgi->header();
my %FORM = $cgi->Vars();
my $mail_destination = $mail_address{$FORM{'Destination'}};
$email = $FORM{'email'};
my $Destination = $FORM{'Destination'};
my $yourname = $FORM{'yourname'};
my $message = $FORM{'message'};
open (MAIL, "| $mailprog") || print "Can't open $mailprog!\n";
print (MAIL "From: $email\n");
print (MAIL "To: $mail_destination\n\n");
foreach my $key(keys(%FORM)){
print MAIL $key,":\t",$FORM{$key},"\n";
}
close MAIL;
1
2
3
4
5
6
7
8
9
10
use Mail::RFC822::Address qw(valid validlist);
[...]
$email = $FORM{'email'};
[...]
if (valid($email)) {
print "That's a valid address\n";
}
if(valid($mail_destination)){
print "Destination address is valid!";
}
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>
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);
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
#!/usr/bin/perl -w
use strict;
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $mailprog = '/usr/sbin/sendmail -t';
my $email = 'zzz@hotmail.com';
my %mail_address = ("France" => 'xxx@hotmail.com',
"Germany" => 'yyy@hotmail.com');
my $cgi = CGI->new();
print $cgi->header();
my %FORM = $cgi->Vars();
my $mail_destination = $mail_address{$FORM{'Destination'}};
$email = $FORM{'email'};
my $Destination = $FORM{'Destination'};
my $yourname = $FORM{'yourname'};
my $message = $FORM{'message'};
open (MAIL, "| $mailprog") || print "Can't open $mailprog!\n";
print (MAIL "From: $email\n");
print (MAIL "To: $mail_destination\n\n");
while(my ($key,$value) = each %FORM){
print MAIL "$key\: $value\n";
}
close (MAIL);
1
2
3
4
5
6
7
...
while my $key,$value = each %FORM {
print MAIL "$key\< $value\<n";
}
close MAIL;
|< 1 2 >| | 14 Einträge, 2 Seiten |