![]() |
|< 1 2 >| | ![]() |
19 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
# for UNIX-Systems my $Mail_Prog = 'sendmail.exe'; open (MAIL, "|$Mail_Prog -t") || die "Mailprogramm konnte nicht gestartet werden "; print MAIL "To: xxx\@yyy.de "; print MAIL "From: $Formular{Name} <$Formular{Email}> "; print MAIL "Subject: Formular Homepage "; # Textbereich Email if( $Formular{Formular} eq "Infomaterial") { # special format for formular "Infomaterial" print MAIL "\[Titel Name\] $Formular{Titel} $Formular{Name} "; print MAIL "\[Firma\] $Formular{Firma} "; print MAIL "\[Adresse\] $Formular ... 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 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 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
sub send_to_blat { # Benötigte Variablen lokal zur Verfügung stellen ; # local($print_config,$key,$sort_order,$sorted_field,$env_report); # Email Subject bestimmen $betreff = ''; if ($Config{'subject'}) { $betreff = $Config{'subject'} } else { $betreff = WWW Form Submission } # Adresse bestimmen $address = $Config{'recipient'}; # Messageinhalt bestimmen # Variable initialisieren, hier soll der komplette Textkörper hineingeschrieben werden $message = 'Anbei die Resultate der Befragung. Sie wurden abgeschickt durch: ' . '$Config{'realname'} ($Config{'email'}) on $date '; # Prüft die Option print_config und handelt entsprechend if (@Print_Config) { foreach $print_config (@Print_Config) { if ($Config{$print_config}) { $message .= '$print_config: $Config{$print_config} '; } } } # Alphabetisch sortieren, falls verlangt &nbs p; # if ($Config{'sort'} eq 'alphabetic') { foreach $field (sort keys %Form) { # If the field has a value or the print blank fields option # # is turned on, print out the form field and value. # if ($Config{'print_blank_fields'} || $Form{$field} || $Form{$field} eq '0') { $message .= '$field: $Form{$field} '; } } } # Felder nach angegebener Reihenfolge sortieren, falls verlangt # elsif ($Config{'sort'} =~ /^order:.*,.*/) { # Remove extraneous line breaks and spaces, remove the order: # # directive and split the sort fields into an array. # $Config{'sort'} =~ s/(\s+| )?,(\s+| )?/,/g; $Config{'sort'} =~ s/(\s+)? +(\s+)?//g; $Config{'sort'} =~ s/order://; @sorted_fields = split(/,/, $Config{'sort'}); # For each sorted field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $sorted_field (@sorted_fields) { if ($Config{'print_blank_fields'} || $Form{$sorted_field} || $Form{$sorted_field} eq '0') { $message .= '$sorted_field: $Form{$sorted_field} '; } } } # Ansonsten in der angegeben Reihenfolge verschicken # else { # For each form field, if it has a value or the print blank # # fields option is turned on print the form field and value. # foreach $field (@Field_Order) { if ($Config{'print_blank_fields'} || $Form{$field} || $Form{$field} eq '0') { $message .= '$field: $Form{$field} '; } } } # System Umgebungsvariablen mit in die Nachricht einpacken &nb sp; # foreach $env_report (@Env_Report) { if ($ENV{$env_report}) { $message .= '$env_report: $ENV{$env_report} '; } } # Zusammenstellen der Kommandozeile für späteren Systemaufruf $commandline = $mailprog; $commandline .= $message; $commandline .= "-s \"$betreff\" " if $betreff; $commandline .= "-t \"$recipients\" " if $recipients; # $commandline .= "-f $config{'email'} " if $config{'email'}; # Senden der Email system($commandline);
1 2 3 4 5 6 7 8 9 10 11 12 13
sub Blat { my $Mail_Prog = 'blat.exe'; my $commandline = $Mail_Prog; $commandline .= " -"; # attach no file $commandline .= " -to xxx\@yyy.de"; # To $commandline .= " -f \"$Formular{Name} $Formular{Email}\""; # From $commandline .= " -s \"Formular Homepage (Blat)\""; # Subject $commandline .= " -body \""; # Body $commandline .= &MailBody; # Body $commandline .= "\""; # Body $commandline .= " -log blatlog.txt"; # Create Logfile for testing # Senden der Email system($commandline);
![]() |
|< 1 2 >| | ![]() |
19 Einträge, 2 Seiten |