I want to send some email automatically, from a script. The utilities "mail" or "mailx" would do, except that I need also to attach a file. Pine has some options, but not completely. Mutt gets closer, but it wants keyboard input: mutt -a photo.jpg -i hello -s "testing" cer@localhost I want it to send with no question asked (for a cron script). Perhaps "sendmail" directly? I have no idea how. -- Cheers, Carlos Robinson
* Carlos E. R. (robin1.listas@tiscali.es) [030513 12:10]:
mutt -a photo.jpg -i hello -s "testing" cer@localhost
I want it to send with no question asked (for a cron script). Perhaps "sendmail" directly? I have no idea how.
echo "blah blah" | mutt -a photo.jpg -i hello -s "testing" \ cer@localhost Also check shelldorado.com for lots of shell examples. -- -ckm
The 03.05.13 at 12:23, Christopher Mahmood wrote:
I want it to send with no question asked (for a cron script). Perhaps "sendmail" directly? I have no idea how.
echo "blah blah" | mutt -a photo.jpg -i hello -s "testing" \ cer@localhost
A mixture of your sugestion and Philip's did it: echo Hola mundo | ./nail -s Hola -a ./names.c -r cer@localhost \ fido@localhost A excerpt from the man page for the archive: NAME nail - send and receive MIME conformant mail SYNOPSIS nail [-BFintv~] [-s subject] [-a attachment ] [-c cc-addr] [-b bcc-addr] [-r from-addr] [-h hops] to-addr . . . nail [-BeHiInNv~] [-T name] -f [name] nail [-BeinNv~] [-u user] DESCRIPTION Nail is an intelligent mail processing system, which has a command syntax reminiscent of ed(1) with lines replaced by messages. It is based on Berkeley Mail 8.1, is intended to provide the functionality of the POSIX.2 mailx command, and offers extensions for MIME messages, POP3 and SMTP.
Also check shelldorado.com for lots of shell examples.
I will as well, I forgot that site. Thank you! -- Cheers, Carlos Robinson
On Tue, 13 May 2003 20:17:20 +0200 (CEST)
"Carlos E. R."
I want to send some email automatically, from a script. The utilities "mail" or "mailx" would do, except that I need also to attach a file.
Use nail: http://omnibus.ruf.uni-freiburg.de/~gritter/ Charles -- "The IETF motto is 'rough consensus and running code'" -- Scott Bradner (Open Sources, 1999 O'Reilly and Associates)
The 03.05.13 at 15:32, Charles Philip Chan wrote:
I want to send some email automatically, from a script. The utilities "mail" or "mailx" would do, except that I need also to attach a file.
Use nail:
Mmm, nice! Seems just the thing. Just downloaded it, will try later. Thanks :-) -- Cheers, Carlos Robinson
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Tuesday 13 May 2003 11:17 am, Carlos E. R. wrote:
I want to send some email automatically, from a script. The utilities "mail" or "mailx" would do, except that I need also to attach a file.
Pine has some options, but not completely. Mutt gets closer, but it wants keyboard input:
mutt -a photo.jpg -i hello -s "testing" cer@localhost
I want it to send with no question asked (for a cron script). Perhaps "sendmail" directly? I have no idea how.
I saw a couple of other replies but I thought you might also want to look at REBOL http://www.rebol.com/ see ya - -- dh Don't shop at GoogleGear.com! -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.1 (GNU/Linux) iD8DBQE+wbmsBwgxlylUsJARArkPAJ9G+yAfGtSL9XOZzNIpNX0g7+LcagCgl20N EvL0Spf+8B8xaWsOx5ZWEk4= =qlDD -----END PGP SIGNATURE-----
On Tue, May 13, 2003 at 08:36:07PM -0700, David Herman wrote: : -----BEGIN PGP SIGNED MESSAGE----- : Hash: SHA1 : : On Tuesday 13 May 2003 11:17 am, Carlos E. R. wrote: : > I want to send some email automatically, from a script. The utilities : > "mail" or "mailx" would do, except that I need also to attach a file. : > : > Pine has some options, but not completely. Mutt gets closer, but it : > wants keyboard input: : > : > mutt -a photo.jpg -i hello -s "testing" cer@localhost : > : > I want it to send with no question asked (for a cron script). Perhaps : > "sendmail" directly? I have no idea how. : : I saw a couple of other replies but I thought you might also want to : look at REBOL : http://www.rebol.com/ Check out 'metamail'. It's included w/SuSE. --Jerry Open-Source software isn't a matter of life or death... ...It's much more important than that!
On Tue, 13 May 2003 20:17:20 +0200 (CEST)
"Carlos E. R."
I want to send some email automatically, from a script. The utilities "mail" or "mailx" would do, except that I need also to attach a file.
Pine has some options, but not completely. Mutt gets closer, but it wants keyboard input:
mutt -a photo.jpg -i hello -s "testing" cer@localhost
I want it to send with no question asked (for a cron script). Perhaps "sendmail" directly? I have no idea how.
Use Perl, there are numerous ways of sending mail with attachments. Do a groups.google search for "perl mail attachments", and you will see various modules developed to do this. Here is one example: #!/usr/bin/perl -w use strict; use Mail::Sender; # How these are defined is left as an exercise to the reader my ($from, $to, $subject, $message, $file, $server); # Create our message handler ref (my $mail = new Mail::Sender { smtp => $server } ) or die "Mail error: $Mail::Sender::Error\n"; # Message header $mail->Open({ from => $from, to => $to, subject => $subject }) or die "Mail error: $Mail::Sender::Error\n"; $mail->Body; # Add the "intro" message $mail->SendLineEnc("$message\n"); # Open $file, adding contents to message open(FILE, "$file"); while(<FILE>) { $mail->SendLineEnc("$_\n"); } # Close & send message $mail->Close; #Alternately, if you wanted to send the file as and attachment, you could do: $mail->Attach({ description => 'Programming Perl 101 Syllabus', ctype => 'text/plain', encoding => '7bit', disposition => 'attachment; filename="syllabus.txt"; type="Text file"', file => 'syllabus.txt' } ); -- use Perl; #powerful programmable prestidigitation
participants (6)
-
Carlos E. R.
-
Charles Philip Chan
-
Christopher Mahmood
-
David Herman
-
Jerry A!
-
zentara