Re: email from shell with htm attachment
Got it to work with a little pipe trick
cat index.html|/bin/addhead.pl|/sendmail joe [at] test.com
#!/usr/bin/perl -w
use strict;
use warnings;
my $mysubject = join(" ", [at] ARGV);
print<<EOF;
Subject: $mysubject
MIME-Version: 1.0
Content-Type: text/html;
charset="windows-1252"
Content-Transfer-Encoding: quoted-printable
EOF
my $lows;
while (my $line = <STDIN>) {
# $lows = lc($line);
$lows = $line;
print "$lows\n";
}
Re: email from shell with htm attachment
joe wrote:
> Got it to work with a little pipe trick
>
> cat index.html|/bin/addhead.pl|/sendmail joe [at] test.com
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> my $mysubject = join(" ", [at] ARGV);
> print<<EOF;
> Subject: $mysubject
> MIME-Version: 1.0
> Content-Type: text/html;
> charset="windows-1252"
> Content-Transfer-Encoding: quoted-printable
> EOF
>
>
>
> my $lows;
>
> while (my $line = <STDIN>) {
> # $lows = lc($line);
> $lows = $line;
>
> print "$lows\n";
> }
Or more simply as:
#!/usr/bin/perl
use strict;
use warnings;
print <<EOF, <STDIN>;
Subject: [at] 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