Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Asperl Mail::Sender Problem

Empfohlene Antworten

Veröffentlicht

Moin Jungs und Mädels,

ich hab hier ein Problem mit nem Formularscript. Irgendwie will das nicht und ich bekomme immer einen Internal Server Error. Nach meiner Logik müsste der Code aber richtig sein! Könnten ihr mal drüber schauen und mich auf etwatige Fehler aufmerksam machen? Danke schonmal!



<%

use Mail::Sender;


my $name=$Request->Form('anrede')." ".$Request->Form('titel')." ".$Request->Form('vorname')." ".$Request->Form('name');

my $firma=$Request->Form('firma');

my $anschrift=$Request->Form('anschrift');

my $land=$Request->Form('land');

my $ort=$Request->Form('plz')." ".$Request->Form('ort');

my $telefon="Telefon: ".$Request->Form('telefon');

my $telefax="Telefax: ".$Request->Form('telefax');

my $email=$Request->Form('email');

my $kommentar=$Request->Form('kommentar');


my $mail= new Mail::Sender{smtp=>'localhost', from=>"$email", subject=>"Anfrage"};


$mail->{'to'}=xxx@yyy.zz;

$mail->Open();

$mail->Send("$name\n$firma\n$anschrift\n$land - $ort\n\n$telefon\n$telefax\nE-Mail: $email\n\n\n$kommentar");

$mail->Close();



%>


Liebe Grüße

Snipes83

ich hab hier ein Problem mit nem Formularscript. Irgendwie will das nicht und ich bekomme immer einen Internal Server Error. Nach meiner Logik müsste der Code aber richtig sein!

Was steht denn in deiner Errorlog?

use Mail::Sender; # Modul verfuegbar?

my $name=$Request->Form('anrede')." ".$Request->Form('titel')." ".$Request->Form('vorname')." ".$Request->Form('name'); # Woher kommt denn $Request? Ist das durch deinen Handler irgendwo vorher definiert?

my $mail= new Mail::Sender{smtp=>'localhost', from=>"$email", subject=>"Anfrage"};

$mail->{'to'}=xxx@yyy.zz; # string?

$mail->Open();

$mail->Send("$name\n$firma\n$anschrift\n$land - $ort\n\n$telefon\n$telefax\nE-Mail: $email\n\n\n$kommentar");

$mail->Close();

Also das ist IIRC komplett falsch. Muesste etwa so gehen:


my $mail= new Mail::Sender[b]([/b]{smtp=>'localhost', from=>$email}[b])[/b];

$mail->MailMSG({to => 'xxx@yyy.zzz', subject => ...});

Naeheres dazu in der Dokumentation von Mail::Sender.



<%

use Mail::Sender;


# ...

%>


Was sollen die "<%" bzw. "%>" für eine Bedeutung haben? Und woher ist $Request definiert?

Was sollen die "<%" bzw. "%>" für eine Bedeutung haben? Und woher ist $Request definiert?

Im Titel steht "Asperl". Ich bin einfach mal davon ausgegangen, dass das sowas wie Apache::ASP sein koennte, wobei ASPerl natuerlich auch die Abkuerzung fuer Active State Perl sein koennte. :D

Zumindest definiert Apache::ASP von sich aus einige Variablen $Session, $Request und $Response, aber ob man die selbst importieren muss, weiss ich nicht. Steht bestimmt in der Dokumentation.

Mmhhh... Stimmt. Ich hatte es als "ActiveState Perl" interpretiert. Sorry.

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.