Re: email from shell with htm attachment

Re: email from shell with htm attachment

am 02.04.2008 14:00:02 von joe

Got it to work with a little pipe trick

cat index.html|/bin/addhead.pl|/sendmail joe@test.com

#!/usr/bin/perl -w

use strict;
use warnings;

my $mysubject = join(" ",@ARGV);
print< Subject: $mysubject
MIME-Version: 1.0
Content-Type: text/html;
charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
EOF



my $lows;

while (my $line = ) {
# $lows = lc($line);
$lows = $line;

print "$lows\n";
}

Re: email from shell with htm attachment

am 02.04.2008 15:11:31 von someone

joe wrote:
> Got it to work with a little pipe trick
>
> cat index.html|/bin/addhead.pl|/sendmail joe@test.com
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> my $mysubject = join(" ",@ARGV);
> print< > Subject: $mysubject
> MIME-Version: 1.0
> Content-Type: text/html;
> charset="windows-1252"
> Content-Transfer-Encoding: quoted-printable
> EOF
>
>
>
> my $lows;
>
> while (my $line = ) {
> # $lows = lc($line);
> $lows = $line;
>
> print "$lows\n";
> }

Or more simply as:

#!/usr/bin/perl
use strict;
use warnings;

print <;
Subject: @ARGV
MIME-Version: 1.0
Content-Type: text/html;
charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
EOF




John
--
Perl isn't a toolbox, but a small machine shop where you
can special-order certain sorts of tools at low cost and
in short order. -- Larry Wall