It sends the attachment, but carriage returns for each line are striped and it comes as all one line.
I eventually want to do this with a script, but not sure how to get this working. I have done some searching, but can't seem to find anything helpful. Can you provide me with some links to scripts that I could look at? Thank you.
Hi Corona688,
The file is being written out by a Cobol program that places a Carriage Return, Line Feed at the end of each line. The uuencode seems to be removing the carriage return. The mail client mutt leaves it intact. Do you know of a way to use mutt at the command line without it bringing up the interactive menu? Thank you.
uuencode is for encoding binary files and really ought to encode what you have verbatim. If carriage returns are missing on the other end, I suspect they're missing on the input too, for whatever reason.
Hi Corona688,
I did some more searching and found that if I code the line this way:
mutt -a jim.txt -s "Test Email" me@mydomain.com < /dev/null
It sends the attachment with the carriage return/line feed. Now I have to figure out how to get the from address in there as it sends it with out one. Any Idea's? Thank you for your help.
Try this (works using Korn shell on Solaris, your options my vary):
#!/bin/ksh
# Convert line feeds from the source and write to attach.out.
unix2dos -437 -ascii data.txt attach.out
# Now uuencode attach.out and call it data.txt for the attachment name.
(print "Please review the attached file";uuencode attach.out data.txt) | mailx -s "Test" myemail@mydomain.com
exit 0
Note that the "attach.out" filename can be omitted from the unix2dos command, where then the original file will be overwritten with the converted version. This example preserves the original data.txt file.
And my response earlier was that the file already has a carriage return and line feed. I also found that mutt works with the command I showed earlier leaving the carriage return/line feeds in place so I only need to figure out how to place the "from" address in the email so that when it is received it has a "from" address. Thank you.
---------- Post updated 02-28-12 at 07:07 AM ---------- Previous update was 02-27-12 at 09:01 PM ----------
Hello all,
I was able to resolve my issue by setting a default email address in the Muttrc config file. This works for my purposes as I will be the only one sending email from this system. For others they will probably want to set up a person config file. The following command is what I end ed up with.