Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to send an attachment using mailx 1

Status
Not open for further replies.

nguyenb9

Technical User
Apr 1, 2003
55
US
I am able to send an attachment text file using uuencode command to my outlook mail, but when I received the attachment everything in one line.

What do I need to do to fix the problem.

Thanks,
Bao N
 
it could be somewhat helpful looking into this forum's FAQs

vlad
+----------------------------+
| #include<disclaimer.h> |
+----------------------------+
 
It does not really answer my question. I would like to send an attachment ascii text email. Can you provide an example.

Thanks

Here is my syntax that I used.
-- uuencode file.txt file.txt |mailx myname@companyname.com
 
It's because it's a unix text file, not a MS-DOS type text file. In unix, each line is terminated with a single character, a line-feed (0x0A). In MS-DOS/Windows, each line of a text file is terminated by a pair of characters, a carriage-return (0x0D) and a line-feed (0x0A). The reason your file appears on one line is because you need to add the carriage-return to each line.

In Sun Solaris, there are two utilities called dos2unix and unix2dos that do this conversion. You would just need to run unix2dos on your file before uuencoding it.

If you are using a different flavor of unix, you'll need to find the equivalent utility, or write your own.

Also, I believe if you view the file in WordPad, it will look ok. WordPad goes ahead and wraps the lines.

Hope this helps.

 
Hi all,

I could send email with attachment using mailx. But I am getting the following warning message,

uuencode: ISO8859-15 to 646 conversion: Invalid argument

I am running the script in SunOS 5.7

I know this is not a fatal error message. but could someone please let me know how to get rid of that message (it keeps coming up in the screen when running my script!).

Thanks in advance,
Karuna
 
How to send attachment text file in UNIX to OUTLOOK as follows:
Two UNIX commands that needs to know:
unix2dos = this command will add return character (^M)to each line in the file.
dos2unix = this command will remove return character (^M) in your file.

convert file1.txt to DOS text file:
unix2dos file1.txt > file2.txt
Then use file2.txt send it to OUTLOOK:
uuencode file2.txt file2.txt |mailx -s &quot;test&quot; names@company.com

I hope this help you.

 
Syntax i used to send attachment by mailx was
uuencode a.txt a.txt | mailx -s &quot;subject&quot; username@emailid.com

When I execute this I get the following warning message:
uuencode: ISO8859-15 to 646 conversion: Invalid argument

mailx still sends the email with attachment. I just wanted to avoid the extra message coming on the screen.

Thanks for reading.
 
Well, this should eliminate the error message...
Code:
   uuencode a.txt a.txt 2>/dev/null | mailx -s &quot;Subject&quot; username@emailid.com
The problem is that this throws away any real error message you may want to keep. You could also do this...
Code:
   uuencode a.txt a.txt 2>uuencode.log | mailx -s &quot;Subject&quot; username@emailid.com
That way any error messages go to a little log file.

Hope this helps.

 
1.Can I have more then one attachment in the same mail ?
2.Can I have some text inside the mail body extra to attachments ?


&quot;Long live king Moshiach !&quot;
 
hello
I tried to send some attachment using the sequence given in precedent threads, but i receive the uuencode result as mail body and no attachment.

Does anybody have some idea about this issue ?

Thanks for your help
fab.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top