Re: How to send attached files on sendmail with mail tool?
On Friday 23 July 2004 01:07 am, Murray Taylor wrote: > man uuencode > > uuencode [-m] [-o output_file] [file] name > > he uuencode utility reads file (or by default the standard input) and > writes an encoded version to the standard output, or output_file if one > has been specified. The encoding uses only printing ASCII characters > and includes the mode of the file and the operand name for use by > uudecode. > > This works with winblows - I use it in production here If it works, use it :-) It's straightforward, and easy enough to test. Jay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
On Fri, 2004-07-23 at 08:07, Murray Taylor wrote: > This works with winblows - I use it in production here > > cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] > ^ ^ > | +--- attachment FILENAME for the target host to > use > +--- attachment CONTENT from the source host > May I suggest an alternative - /usr/ports/mail/p5-Mail-Sender Install this perl module and then you can easily write a simple script to handle your attachments. Something like the following: #!/usr/local/bin/perl -w use Mail::Sender; $to = $ARGV [0]; $replyto = "[EMAIL PROTECTED]"; $subject = $ARGV [1]; $file= $ARGV [2]; $mesg= $ARGV [3]; $from= "[EMAIL PROTECTED]"; if (! $file ) { PrintUsage(); die "\n"; } else { $sender = new Mail::Sender {smtp => 'your.smtp.server.ip', from => $from}; $sender->MailFile({ to => $to, replyto => $replyto, subject => $subject, msg => $mesg, file=> $file}); print "The file $file has been sent to $to\n"; }; sub PrintUsage { print "Usage: mailfile.pl"; }; Not tested but should work, just alter to suit your needs. Regards, -- Nelis Lamprecht PGP: http://www.8ball.co.za/pgpkey/nelis.asc "Unix IS user friendly.. It's just selective about who its friends are." signature.asc Description: This is a digitally signed message part
Re: How to send attached files on sendmail with mail tool?
man uuencode uuencode [-m] [-o output_file] [file] name he uuencode utility reads file (or by default the standard input) and writes an encoded version to the standard output, or output_file if one has been specified. The encoding uses only printing ASCII characters and includes the mode of the file and the operand name for use by uudecode. This works with winblows - I use it in production here cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] ^ ^ | +--- attachment FILENAME for the target host to use +--- attachment CONTENT from the source host the input file is via stdin to uuencode - this becomes the CONTENT of the attachment the File name given to the ATTACHMENT is the tgt_filename The result is an email with only on thing inside it - the attachment. On Fri, 2004-07-23 at 15:57, Jay Moore wrote: > On Wednesday 21 July 2004 02:10 am, Wojciech Puchar wrote: > > > > cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] > > > > uuencode > > > instead of cat. less one unneeded piping. > > > > > > subject can be derived from shell script variables if necessary. > > > > > > Do you have to do a uudecode on the receiving end to recover the file? > > > > > > I tried this - sending a pdf file from this FreeBSD system to a Windoze > > > user that gets mail via POP - it didn't work. The filename came through, > > > and it was listed as an attachment, but there was nothing useful in the > > > file. > > > > i think windoze just can't decode uuencoded attachments right. > > > > it only supports base64 right. > > > > metamail will be useful, possibly > > > > /usr/local/bin/encode-base64 was installed by package p5-MIME-Base64-2.21 > > I'm sure you are correct about Windows... I guess the point I was trying to > make is that I think Base64 encoding and appropriate MIME headers are > required to be placed in the message to make it a "compliant" message. So > while this script may work in certain limited situations, it's probably not a > good "general purpose" solution. > > Jay > > > This Email has been scanned for Viruses by MailMarshal. > -- Murray Taylor Special Projects Engineer - Bytecraft Systems & Entertainment P: +61 3 8710 2555 F: +61 3 8710 2599 D: +61 3 9238 4275 M: +61 417 319 256 E: [EMAIL PROTECTED] or visit us on the web http://www.bytecraftsystems.com http://www.bytecraftentertainment.com --- The information transmitted in this e-mail is for the exclusive use of the intended addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material. E-mails may not be secure, may contain computer viruses and may be corrupted in transmission. Please carefully check this e-mail (and any attachment) accordingly. No warranties are given and no liability is accepted for any loss or damage caused by such matters. --- This Email has been scanned for Viruses by MailMarshal. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
On Wednesday 21 July 2004 02:10 am, Wojciech Puchar wrote: > > > cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] > > uuencode > instead of cat. less one unneeded piping. > > > > subject can be derived from shell script variables if necessary. > > > > Do you have to do a uudecode on the receiving end to recover the file? > > > > I tried this - sending a pdf file from this FreeBSD system to a Windoze > > user that gets mail via POP - it didn't work. The filename came through, > > and it was listed as an attachment, but there was nothing useful in the > > file. > > i think windoze just can't decode uuencoded attachments right. > > it only supports base64 right. > > metamail will be useful, possibly > > /usr/local/bin/encode-base64 was installed by package p5-MIME-Base64-2.21 I'm sure you are correct about Windows... I guess the point I was trying to make is that I think Base64 encoding and appropriate MIME headers are required to be placed in the message to make it a "compliant" message. So while this script may work in certain limited situations, it's probably not a good "general purpose" solution. Jay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
> > > > cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] uuencode > > > subject can be derived from shell script variables if necessary. > > Do you have to do a uudecode on the receiving end to recover the file? > > I tried this - sending a pdf file from this FreeBSD system to a Windoze user > that gets mail via POP - it didn't work. The filename came through, and it > was listed as an attachment, but there was nothing useful in the file. > i think windoze just can't decode uuencoded attachments right. it only supports base64 right. metamail will be useful, possibly /usr/local/bin/encode-base64 was installed by package p5-MIME-Base64-2.21 ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
On Sunday 18 July 2004 07:38 pm, Murray Taylor wrote: > > cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] > > You can send .tgz, .tar.gz, .xls, .csv, ... files using this method.. > > Ie any file at all as the uuencode does all the necessaries to make the > file into 7bit ascii. > > subject can be derived from shell script variables if necessary. Do you have to do a uudecode on the receiving end to recover the file? I tried this - sending a pdf file from this FreeBSD system to a Windoze user that gets mail via POP - it didn't work. The filename came through, and it was listed as an attachment, but there was nothing useful in the file. Jay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
Carla, cat file | uuencode tgt_filname | mail -s "subject" [EMAIL PROTECTED] You can send .tgz, .tar.gz, .xls, .csv, ... files using this method.. Ie any file at all as the uuencode does all the necessaries to make the file into 7bit ascii. subject can be derived from shell script variables if necessary. mjt On Sat, 2004-07-17 at 06:36, Carla Neves wrote: > Hi Dear all, > I'm doing some scripts to automaticly deliver to some email accounts > Unix system printouts. I'm using sendmail on Freebsd 4.9 and the mail > tool to send my emails. What I would like to know is: is it possible > to send emails with files attached using the sendmail and the mail > tool? Which syntax should I aply to send an attached file in the > message? > > I would appreciate your help. > > P.S: I' using this syntax so far for sending emails > > mail -s "Automatic Message" [EMAIL PROTECTED] < The contents of the message goes here. > > E_O_M > > or to pipe stuff directly into sendmail: > > /usr/sbin/sendmail -t -oi -oem < To: [EMAIL PROTECTED] > Subject: Automatic Message > > The contents of the message goes here. > > As much as you like, really. > > E_O_M > > > Regards, > Carla > ___ > [EMAIL PROTECTED] mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-questions > To unsubscribe, send any mail to "[EMAIL PROTECTED]" > > > This Email has been scanned for Viruses by MailMarshal. > -- Murray Taylor Special Projects Engineer - Bytecraft Systems & Entertainment P: +61 3 8710 2555 F: +61 3 8710 2599 D: +61 3 9238 4275 M: +61 417 319 256 E: [EMAIL PROTECTED] or visit us on the web http://www.bytecraftsystems.com http://www.bytecraftentertainment.com --- The information transmitted in this e-mail is for the exclusive use of the intended addressee and may contain confidential and/or privileged material. Any review, re-transmission, dissemination or other use of it, or the taking of any action in reliance upon this information by persons and/or entities other than the intended recipient is prohibited. If you received this in error, please inform the sender and/or addressee immediately and delete the material. E-mails may not be secure, may contain computer viruses and may be corrupted in transmission. Please carefully check this e-mail (and any attachment) accordingly. No warranties are given and no liability is accepted for any loss or damage caused by such matters. --- This Email has been scanned for Viruses by MailMarshal. ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
On Sunday 18 July 2004 10:35 am, Shantanoo wrote: > | I'm doing some scripts to automaticly deliver to some email accounts > | Unix system printouts. I'm using sendmail on Freebsd 4.9 and the mail > | tool to send my emails. What I would like to know is: is it possible > | to send emails with files attached using the sendmail and the mail > | tool? Which syntax should I aply to send an attached file in the > | message? > | > | I would appreciate your help. > | > | P.S: I' using this syntax so far for sending emails > | > | mail -s "Automatic Message" [EMAIL PROTECTED] < | The contents of the message goes here. > | > | E_O_M > | > | or to pipe stuff directly into sendmail: > | > | /usr/sbin/sendmail -t -oi -oem < | To: [EMAIL PROTECTED] > | Subject: Automatic Message > | > | The contents of the message goes here. > | > | As much as you like, really. > | > | E_O_M > | > > I don't think you can do it. I would have used mutt in such case. > > e.g. > echo "contents of the bodt" | mutt -a attach_file -s "subject" > [EMAIL PROTECTED] > I don't see anything in 'man mail' that suggests mail could do this. I don't know about sendmail - it has a configuration option for "everything" :) , but may be more trouble than it's worth. You could do as Shantanoo suggested w/ mutt; there are probably similar incantations for pine, elm, etc. Doing it from a shell script is probably possible if you're willing to do all of the mime stuff. However, I think I'd look at Perl... I think if you found the right package this would be fairly straightforward. HTH, Jay ___ [EMAIL PROTECTED] mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-questions To unsubscribe, send any mail to "[EMAIL PROTECTED]"
Re: How to send attached files on sendmail with mail tool?
+++ Carla Neves [freebsd] [16-07-04 21:36 +0100]: | Hi Dear all, | I'm doing some scripts to automaticly deliver to some email accounts | Unix system printouts. I'm using sendmail on Freebsd 4.9 and the mail | tool to send my emails. What I would like to know is: is it possible | to send emails with files attached using the sendmail and the mail | tool? Which syntax should I aply to send an attached file in the | message? | | I would appreciate your help. | | P.S: I' using this syntax so far for sending emails | | mail -s "Automatic Message" [EMAIL PROTECTED]
How to send attached files on sendmail with mail tool?
Hi Dear all, I'm doing some scripts to automaticly deliver to some email accounts Unix system printouts. I'm using sendmail on Freebsd 4.9 and the mail tool to send my emails. What I would like to know is: is it possible to send emails with files attached using the sendmail and the mail tool? Which syntax should I aply to send an attached file in the message? I would appreciate your help. P.S: I' using this syntax so far for sending emails mail -s "Automatic Message" [EMAIL PROTECTED]