Operating System - HP-UX
1834022 Members
2462 Online
110063 Solutions
New Discussion

attach text file with mailx in a script

 
Edmund_5
New Member

attach text file with mailx in a script

Hi experts:
I had a script run everyday to gen report, send as an email, but now I would like to send the text report as an attachment, is that possible to do so, I had try to use uuencode, but the report format is totally different with the orginial one. so please help me on this?
5 REPLIES 5
Elmar P. Kolkman
Honored Contributor

Re: attach text file with mailx in a script

This question passed last week too. Take a look in the history.

A possible solution:
cat | uuencode | mailx -s ""

And you could look if elm is available on your machine. That mailer can solve your problem too.
Every problem has at least one solution. Only some solutions are harder to find.
Hoefnix
Honored Contributor

Re: attach text file with mailx in a script

If you add an ux2dos to the reply of Elmar the report must look the same:

ux2dos | uuencode | mailx -s "...." email@....com

Bernhard Mueller
Honored Contributor

Re: attach text file with mailx in a script

Guess you want to send plain text readable as such, then try

cat | mailx -m -s ""

Regards,
Bernhard

Rita C Workman
Honored Contributor

Re: attach text file with mailx in a script

There a couple ways to do this. For myself, the include statement has always worked well in scripting, for a variety of types of files you want as 'true attachments' (i.e. not in the body).

Have a look here:

http://forums1.itrc.hp.com/service/forums/parseCurl.do?CURL=%2Fcm%2FQuestionAnswer%2F0%2C%2C0x41950559ff7cd4118fef0090279cd0f9%2C00.html&admit=716493758+1066909763545+28353475

Rgrds,
Rita
Steven E. Protter
Exalted Contributor

Re: attach text file with mailx in a script

How about a script based on sendmail?

Attached.

SEP
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