Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

email from shell with htm attachment
Hello  I have a program that outputs html. When i do
program |mail -s "test" joe@test.com
My email client outputs the html code on the screen
if I do
program|uuencode index.htm |mail -s "test" joe@test.com
I get the uuencode on the screen but i cant read the html

currently i am using
program > test.htm
mutt -a test.htm joe@test.com <"."
is there a way to do this without having to write the file to disk? I
have tried the same actions with many email clients and I get the same
error over and over. May be i need to put something in the header of
the output the script. ANy suggestions? thanks.



Report this thread to moderator Post Follow-up to this message
Old Post
joe
03-28-08 12:27 AM


Re: email from shell with htm attachment
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<<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";
}


Report this thread to moderator Post Follow-up to this message
Old Post
joe
04-02-08 01:26 PM


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@test.com
>
> #!/usr/bin/perl -w
>
> use strict;
> use warnings;
>
> my $mysubject = join(" ",@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: @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

Report this thread to moderator Post Follow-up to this message
Old Post
John W. Krahn
04-02-08 01:26 PM


Re: email from shell with htm attachment
Just noticed  that

I had to remove Content-Transfer-Encoding: quoted-printable
On Apr 2, 9:11 am, "John W. Krahn" <some...@example.com> wrote:
> joe wrote: 
> 
> 
> 
> 
> 
> 
> 
>
> Or more simply as:
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> print <<EOF, <STDIN>;
> 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


Report this thread to moderator Post Follow-up to this message
Old Post
joe
04-03-08 03:54 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Shell Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 11:20 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.