1748238 Members
3710 Online
108759 Solutions
New Discussion юеВ

sendmail issue

 
SOLVED
Go to solution
prashantb
Occasional Advisor

sendmail issue

how to send mail with file as attachment with the particular mail id in HPUX 11.23. I tried with mail,mailx,elm the file goes as a body of message and message send using mail id root@servername.xyz.com
How to resolve the issue?
12 REPLIES 12
Jeeshan
Honored Contributor

Re: sendmail issue

Jeeshan
Honored Contributor

Re: sendmail issue

Hi again

also see this thread

http://forums11.itrc.hp.com/service/forums/questionanswer.do?threadId=1161579
a warrior never quits
Steven Schweda
Honored Contributor

Re: sendmail issue

Or do a forum search for terms like:
mail attachment

I believe that this problem has been solved
before.
Dennis Handly
Acclaimed Contributor

Re: sendmail issue

You can also use shar(1) and mail that file.

If you don't need to automate it, you can install thunderbird and just use the shiny buttons in the GUI.
OFC_EDM
Respected Contributor

Re: sendmail issue

uuencode /path/filename1 filename1 | mailx -m -s "subject" tosomeone@somewhere.com

filename1 and filename1a are the same.

But you can change the name of the attached file by changing filename1a to get past filters.

For example

uuencode /tmp/somefile.zip somefile.txt | mailx -m -s "subject" tosomeone@somewhere.com

The file sent will be somfile.zip
The name of the attachment will be somefile.txt.

Cheers
The Devil is in the detail.
prashantb
Occasional Advisor

Re: sendmail issue

The sloution is workng fine but the mail id by which mail send is root@hpsrv1.com
Is it possible to put valid mail id for sender.
OFC_EDM
Respected Contributor

Re: sendmail issue

Which solution did you go with?
Can you provide sample?
The Devil is in the detail.
OFC_EDM
Respected Contributor
Solution

Re: sendmail issue

Use the -r option to change the address of the sender.

I.E. As root from server testhpux want to send email as if it came from john@testhpux

echo test | mailx -s "subject" -r john@testhpux.com someuser@out.there
The Devil is in the detail.
prashantb
Occasional Advisor

Re: sendmail issue

Thanks Kevin and all who help to find the solution. Final working pattern for the same is as below,

(uuencode /mail.txt mail.txt)|mailx -m -s "report" -r psb@hotmail.com ravi@yahoo.com