![]() |
|< 1 2 3 >| | ![]() |
23 Einträge, 3 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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#!C:/Program Files/Perl/bin/perl
use Net::SMTP;
use MIME::Lite;
my $Label;
my $TmpAdressTo;
my $TmpEmailAddressTo;
print FILE "\n********************** NEW RECORD ************************\n";
# Get the input
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
# Split the name-value pairs
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
if ($name eq 'firstname') {
$firstname = $value;
}
if ($name eq 'lastname') {
$lastname = $value;
}
if ($name eq 'ValA') {
$ValA = $value;
}
if ($name eq 'email') {
$email = $value;
}
if ($name eq 'studiengang') {
$studiengang = $value;
($Label,$TmpAdressto)=split(/=/,$zeile);
$TmpAdressto=~s/\s//g;
chomp($TmpAdressto);
if ($TmpAdressto eq 'xxx')
{
$TmpEmailAddressto="x\@x";
}
elsif ($TmpAdressto eq 'xxx')
{
$TmpEmailAddressto="x\@x.de";
}
else
{
$TmpEmailAddressto="x\@x.de";
}
last;
}
}
if ( ($firstname eq '') || ($lastname eq '') || ($matriculation eq '') || ($email eq '') ) {
print "Content-type: text/html\n\n";
print "\n\n";
print "Blabla!<br><br>";
print "\n\n";
print "Blabla!";
print "\n\n";
stop();
}
$filename = "exercises/".$firstname."_".$lastname."_".time().".txt";
$htmlfilename = $filename.".html";
open (FILE, ">$filename");
open (HTMLFILE, ">$htmlfilename");
print HTMLFILE "<HTML>";
print HTMLFILE "<BODY>";
print HTMLFILE "<BODY>";
print HTMLFILE "<TABLE bgColor=\"#ffcc66\" border=\"1\" width=\"80%\" align=\"center\">";
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
# Un-Webify plus signs and %-encoding
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$value =~ s/<!--(.|\n)*-->//g;
if ($allow_html != 1) {
$value =~ s/<([^>]|\n)*>//g;
}
$FORM{$name} = $value;
if ($name ne 'Submit')
{
print FILE $name;
print FILE "=";
print FILE $value;
print FILE "\n";
print HTMLFILE "<TR>\n";
print HTMLFILE "<TD>";
print HTMLFILE $name;
print HTMLFILE "</TD>\n";
print HTMLFILE "<TD>";
print HTMLFILE $value;
print HTMLFILE "</TD>\n";
print HTMLFILE "</TR>\n";
}
}
print HTMLFILE "</TABLE>";
print HTMLFILE "</BODY>";
print HTMLFILE "</HTML>";
close (FILE);
close (HTMLFILE);
my $emaillinks;
my $emailrechts;
($emaillinks, $emailrechts) = split(/@/, $email);
$cc_address = $emaillinks."\@".$emailrechts;
print "Content-type: text/html\n\n";
print "<br><br><CENTER>\n";
print "<h2>Blablabla\n";
#Email variables.
$mail_server = "xxx";
$from_address = "xxx";
$to_address = $TmpEmailAddressto;
$subject = $lastname." ".$firstname." xxx";
$body = "body";
$mimeType = "text/html";
$message_body = "<HTML><BODY><CENTER><h2>Absender: ".$lastname." ".$firstname." ".$ValA."</H2></CENTER></BODY></HTML>";
MIME::Lite->send("smtp", $mail_server);
# Create the initial text of the message
$mime_msg = MIME::Lite->new(
From => $from_address,
To => $to_address,
Cc => $cc_address,
Subject => $subject,
Type => $mimeType,
Data => $message_body
) or die "Error creating MIME body: $!\n";
$mime_msg->attach(
Type => "text/html",
Disposition => "attachment",
Path => $htmlfilename,
Filename => $htmlfilename,
);
$mime_msg->send();
renee+2008-05-21 13:07:29--Also hast Du meinen Code gar nicht ausprobiert??
![]() |
|< 1 2 3 >| | ![]() |
23 Einträge, 3 Seiten |