Mailing List
Home
Linux - General Red Hat Linux discussion list
Enterprise Linux 3 - Discussion of Red Hat Enterprise Linux 3 (Taroon)
Red Hat Linux 9 - Discussion of Red Hat Linux 9 (Shrike)
Installation - Getting started with Red Hat Linux
Red Hat Linux 7.3 - Discussion of Red Hat Linux 7.3 (Valhalla)
Red Hat Linux 8.0 - Discussion of Red Hat Linux 8.0 (Psyche)
Red Hat Linux 7.2 - Discussion of Red Hat Linux 7.2 (Enigma)
Red Hat Linux 7.1 - Discussion of Red Hat Linux 7.1 (Seawolf)
Apache Web Server
Oracle database, Microsoft SQL server ...
Subjects
application/x mplayer2 plugin
RPM error: db4 error(16) from dbenv >remove: Device or resource
   busy
Command stream end of file while reading
X Windows problem (xauth)
Upgrading openoffice 1 1 rpm
FTP: connection refused
FTP: connection refused
mount: /dev/cdrom: is not a valid block device
Dell Precision 650, RedHat 9, no sound
how to trace the cause resulting in the crash of bind server
Virus on the list
UNINSTALL RPM MYSQL
usb pen drives: mounting as a user
broadcom network interface
make mrproper
sendmail configuration on redhat
Couldn 't open PID file /var/run/named/named pid Permission denied
Promise 378 controller
kernel 2 6 and /dev/sound/mixer not found
Problem using up2date
mrtg step by step howto/configuration for a newbie?
Compiling and Installing Kernel 2 6
Can 't locate module ppp0, can 't locate module ppp compress 21
HOW I CAN MAKE BOOTABLE FLOPPY DISKET
Lotus Notes under Wine
/etc/security/limits conf question
Intel E/1000 driver
Command stream end of file while reading
rpm database corrupt
qla2300 modules
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
Help Me with shell script please

Help Me with shell script please

2004-01-16       - By Jason Dixon

 Back
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

On Fri, 2004-01-16 at 21:01, Ben Yau wrote:

> Because to my untrained eye (untrained in mail::internet) your perl script
> did not represent any "refined control " and I was wondering where that was
> coming from. I 'll explain that in more detail in the next section because
> that 's where it 's more relevant

That one-liner is a simple solution to your original question. It
doesn 't provide any fine-grained control, as your OP didn 't suggest you
needed it. However, I did mention Mail::Internet in the off-chance that
you might need something like that later on. It 's up to you to
investigate the module 's features if you think you 'll find it useful.

> 1) your example above looks like a regular perl script, which to me doesn 't
> have much of an advantage over running it from the command line, and to my
> untrained eye definitely wouldn 't give you refined control over headers.
> In fact, it is less desirable because you 're just addig a wrapper to 'mail '.
> Why not just run 'mail ' directly from bash instead of running it from perl
> which will run it from bash?

Fine.

$ for i in `cat address.txt`; do echo "message goes here " | mail -s
"subject goes here " $i; done

Feel better now?

> 2) since I give everyone the benefit of the doubt, and since I 'm not
> familiar with Mail::Internet, I was assuming I was missing something, which
> is why I was asking for clarification and which is also why I said in the
> email you responded to:

No, you weren 't missing anything. I was just tossing out a tidbit for
future investigation, if you 're so inclined. This is all getting a
little ridiculous. If you want to use the Perl one-liner, feel free.
If not, use your own code or the shell example I gave above. I 'm sure
you feel I 've slighted you somehow even though I 've taken out of my own
time to give you an example, while you 've taken time to nitpick
everything in my posts.

Nevertheless, I 'm going to lay this out for you, just so you can 't say I
never explained Mail::Internet.

=================================================
#!/usr/bin/perl

use strict;
use Mail::Internet;

my $head = Mail::Header- >new(Modify = > 1);
$head- >add(From = > 'joe@(protected) ');
$head- >add(To = > 'jane@(protected) ');
$head- >add(Subject = > 'Just a test mail ');
$head- >add(Sender = > 'joe@(protected) ');

my $body .= "Message goes here. ";
my $mail = Mail::Internet- >new(Header = > $head,
            Body = > [$body],
            Modify = > 1,
);
my $success = $mail- >smtpsend(Host = > 'smtp.localhost.com ', Hello = > 'localhost.com ');

# EOF
================================================


--
Jason Dixon, RHCE
DixonGroup Consulting
http://www.dixongroup.net


--
redhat-list mailing list
unsubscribe mailto:redhat-list-request@(protected)?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/redhat-list