cancel
Showing results for 
Search instead for 
Did you mean: 

Email attachment question

Mahen Partha
Occasional Visitor

Email attachment question

Guys,

I tested the following piece for email attachment. It works great, I could see attachment on microsoft exchange and hotmail, but I could not see any attachment on yahoo.com. Instead the attachment, I am seeing the content written on the body. Can you guys help me here?

# uuencode myfile myfile > myfile.out
# cat content.txt myfile.out > final
# cat final|mailx -m -s "hello there" abc@yahoo.com

Thanx,
Mahen.
9 REPLIES
Hai Nguyen_1
Honored Contributor

Re: Email attachment question

Mahen,

There are many good links in the forum on this. Below is an example:

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xef2536e69499d611abdb0090277a778c,00.html

For more similar links, try searching "attachment" in the forum.

Good Luck.

Hai
harry d brown jr
Honored Contributor

Re: Email attachment question

Try


uuencode myfile myfile.txt | mailx -m -s "hello there" abc@yahoo.com


And of course, what is in

content.txt?

live free or die
harry
Live Free or Die
Shannon Petry
Honored Contributor

Re: Email attachment question

mailx supports attachments? Last I checked, it did not. I had to use elm to do this. You can use sendmail as well, but think that mailx supports text only.

Search forums for mail and attachments, and you will get a ton of data.

The best part of using elm is that I did not have to uuencode manually, elm did this for me.

Regards,
Shannon

ps if you can find anything, I can post what I have working. Make sure the version of elm you are using supports attachments.
Microsoft. When do you want a virus today?
harry d brown jr
Honored Contributor

Re: Email attachment question

Shannon,

With the uuencode'ing of the "attachment", it doesn't matter if mailx supports attachments or not, as uuencode sends (in this case pipes it to mailx) the "attachment" as TEXT.

I use this method to send files and such from unix boxes to my M$ boxes all of the time.

live free or die
harry
Live Free or Die
Shannon Petry
Honored Contributor

Re: Email attachment question

Harry,

When I tried this approach, I received the uuencoded data at plain text, which I had to manually save, strip headers, and decode the data. Not as easy as elm.


Shannon
Microsoft. When do you want a virus today?
Paul Sperry
Honored Contributor

Re: Email attachment question

Try using elm.
It supports attachments, works like a charm.
harry d brown jr
Honored Contributor

Re: Email attachment question

Shannon,

I think the trick is to identify to the mail receiver what kind of attachment the uuencode'd data is. If it's a WORD DOC, aka a .doc then you do this:

uuencode someword.doc someword.doc | mailx -m -s "my word doc" user@domain.com

live free or die
harry
Live Free or Die
Steven E. Protter
Exalted Contributor

Re: Email attachment question

This script should work with ascii.

http://www2.itrc.hp.com/service/cki/docDisplay.do?docLocale=en_US&admit=-1335382922+1041874332031+28353475&docId=200000062684425

Three versions. A messed up relay server can make you think these scripts are broken. They probably aren't.

Stevve
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Rita C Workman
Honored Contributor

Re: Email attachment question

Well there are a number of ways to do it. Each has it's good points.

I myself prefer to use elm ( as mailx is actually for message broadcasts, and elm and sendmail are true mailers--just my opinion)and then I like to utilize [include].

Here's a thread that gives you some insight in using the [include] statment to attach files:

http://forums.itrc.hp.com/cm/QuestionAnswer/0,,0x41950559ff7cd4118fef0090279cd0f9,00.html

Regards,
Rita