Hello everyone. We are writing a little script that sends a mail to a collegue or department in case of sickness. We have a website that we host that can also be accessed remote with a form to fill out.
Our problem is after trying some things that the Mail arrives with no Subject. The subject is always empty and we dont understand why. Any idea? Here is most of the Script:
if (eingabefehler() == 1) {
print $cgi->header(),
$cgi->start_html('Krankmeldung nicht abgeschickt!'),
$cgi->h1('Bitte alle Eingabefelder ausfüllen');
print $cgi->end_html();
}
else {
$abt = $cgi->param('abt');
$smtp = Net::SMTP->new('cluster.xx.xx',Timeout => 30);
$smtp->mail($ENV{USER});
switch($abt)
{
case "xx" { $smtp->to('mail.address'); )
}
$smtp->cc('mail.address');
$smtp->mail($ENV{USER});
$smtp->data();
$smtp->datasend("From: Krankmeldeformular\n");
switch($abt)
{
case "xx" { $smtp->datasend("To: person"); }
}
$smtp->datasend("Subject: Krankmeldung\n");
$smtp->datasend("\n");
$smtp->datasend("Name: ",$cgi->param('name'),"\n\n");
$smtp->datasend("Datum: ",$cgi->param('datum'),"\n\n");
switch($abt)
{
case "xx" { $smtp->datasend("department \\n\\n"); }
}
$smtp->dataend();
$smtp->quit;
print $cgi->header(),
$cgi->start_html('Krankmeldung abgeschickt!'),
$cgi->h1('Mail versendet');
print $cgi->end_html();
}
submitted by /u/Lionsrise
[link] [comments]